Skip to content

Commit

Permalink
merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
davidterpay committed Dec 6, 2023
1 parent 5f6b47c commit ddf833e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 24 deletions.
14 changes: 1 addition & 13 deletions abci/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,12 @@ func (h *ProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHandler {
"height", req.Height,
)

<<<<<<< HEAD
// Fill the proposal with transactions from each lane.
finalProposal, err := h.prepareLanesHandler(ctx, proposals.NewProposalWithContext(ctx, h.logger))
=======
registry, err := h.mempool.Registry(ctx)
if err != nil {
h.logger.Error("failed to get lane registry", "err", err)
return &abci.ResponsePrepareProposal{Txs: make([][]byte, 0)}, err
}

// Get the max gas limit and max block size for the proposal.
_, maxGasLimit := proposals.GetBlockLimits(ctx)
proposal := proposals.NewProposal(h.logger, req.MaxTxBytes, maxGasLimit)

// Fill the proposal with transactions from each lane.
prepareLanesHandler := ChainPrepareLanes(registry)
finalProposal, err := prepareLanesHandler(ctx, proposal)
>>>>>>> 43d6b04 (req size check (#269))
finalProposal, err := h.prepareLanesHandler(ctx, proposal)
if err != nil {
h.logger.Error("failed to prepare proposal", "err", err)
return &abci.ResponsePrepareProposal{Txs: make([][]byte, 0)}, err
Expand Down
8 changes: 4 additions & 4 deletions abci/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ func (s *ProposalsTestSuite) TestPrepareProposalEdgeCases() {
s.Require().NoError(err)

proposalHandler := abci.NewProposalHandler(
log.NewTestLogger(s.T()),
log.NewNopLogger(),
s.encodingConfig.TxConfig.TxDecoder(),
s.encodingConfig.TxConfig.TxEncoder(),
mempool,
Expand Down Expand Up @@ -546,7 +546,7 @@ func (s *ProposalsTestSuite) TestPrepareProposalEdgeCases() {
s.Require().NoError(err)

proposalHandler := abci.NewProposalHandler(
log.NewTestLogger(s.T()),
log.NewNopLogger(),
s.encodingConfig.TxConfig.TxDecoder(),
s.encodingConfig.TxConfig.TxEncoder(),
mempool,
Expand Down Expand Up @@ -595,7 +595,7 @@ func (s *ProposalsTestSuite) TestPrepareProposalEdgeCases() {
s.Require().NoError(err)

proposalHandler := abci.NewProposalHandler(
log.NewTestLogger(s.T()),
log.NewNopLogger(),
s.encodingConfig.TxConfig.TxDecoder(),
s.encodingConfig.TxConfig.TxEncoder(),
mempool,
Expand Down Expand Up @@ -644,7 +644,7 @@ func (s *ProposalsTestSuite) TestPrepareProposalEdgeCases() {
s.Require().NoError(err)

proposalHandler := abci.NewProposalHandler(
log.NewTestLogger(s.T()),
log.NewNopLogger(),
s.encodingConfig.TxConfig.TxDecoder(),
s.encodingConfig.TxConfig.TxEncoder(),
mempool,
Expand Down
10 changes: 5 additions & 5 deletions abci/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (s *ProposalsTestSuite) setUpCustomMatchHandlerLane(maxBlockSpace math.Lega

func (s *ProposalsTestSuite) setUpStandardLane(maxBlockSpace math.LegacyDec, expectedExecution map[sdk.Tx]bool) *defaultlane.DefaultLane {
cfg := base.LaneConfig{
Logger: log.NewTestLogger(s.T()),
Logger: log.NewNopLogger(),
TxEncoder: s.encodingConfig.TxConfig.TxEncoder(),
TxDecoder: s.encodingConfig.TxConfig.TxDecoder(),
AnteHandler: s.setUpAnteHandler(expectedExecution),
Expand All @@ -91,7 +91,7 @@ func (s *ProposalsTestSuite) setUpStandardLane(maxBlockSpace math.LegacyDec, exp

func (s *ProposalsTestSuite) setUpTOBLane(maxBlockSpace math.LegacyDec, expectedExecution map[sdk.Tx]bool) *mev.MEVLane {
cfg := base.LaneConfig{
Logger: log.NewTestLogger(s.T()),
Logger: log.NewNopLogger(),
TxEncoder: s.encodingConfig.TxConfig.TxEncoder(),
TxDecoder: s.encodingConfig.TxConfig.TxDecoder(),
AnteHandler: s.setUpAnteHandler(expectedExecution),
Expand All @@ -105,7 +105,7 @@ func (s *ProposalsTestSuite) setUpTOBLane(maxBlockSpace math.LegacyDec, expected

func (s *ProposalsTestSuite) setUpFreeLane(maxBlockSpace math.LegacyDec, expectedExecution map[sdk.Tx]bool) *free.FreeLane {
cfg := base.LaneConfig{
Logger: log.NewTestLogger(s.T()),
Logger: log.NewNopLogger(),
TxEncoder: s.encodingConfig.TxConfig.TxEncoder(),
TxDecoder: s.encodingConfig.TxConfig.TxDecoder(),
AnteHandler: s.setUpAnteHandler(expectedExecution),
Expand Down Expand Up @@ -139,11 +139,11 @@ func (s *ProposalsTestSuite) setUpPanicLane(name string, maxBlockSpace math.Lega
}

func (s *ProposalsTestSuite) setUpProposalHandlers(lanes []block.Lane) *abci.ProposalHandler {
mempool, err := block.NewLanedMempool(log.NewTestLogger(s.T()), lanes)
mempool, err := block.NewLanedMempool(log.NewNopLogger(), lanes)
s.Require().NoError(err)

return abci.NewProposalHandler(
log.NewTestLogger(s.T()),
log.NewNopLogger(),
s.encodingConfig.TxConfig.TxDecoder(),
s.encodingConfig.TxConfig.TxEncoder(),
mempool,
Expand Down
2 changes: 1 addition & 1 deletion lanes/base/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,7 @@ func (s *BaseTestSuite) initLane(
expectedExecution map[sdk.Tx]bool,
) *defaultlane.DefaultLane {
config := base.NewLaneConfig(
log.NewTestLogger(s.T()),
log.NewNopLogger(),
s.encodingConfig.TxConfig.TxEncoder(),
s.encodingConfig.TxConfig.TxDecoder(),
s.setUpAnteHandler(expectedExecution),
Expand Down
2 changes: 1 addition & 1 deletion lanes/mev/mev_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (s *MEVTestSuite) initLane(
expectedExecution map[sdk.Tx]bool,
) *mev.MEVLane {
config := base.NewLaneConfig(
log.NewTestLogger(s.T()),
log.NewNopLogger(),
s.encCfg.TxConfig.TxEncoder(),
s.encCfg.TxConfig.TxDecoder(),
s.setUpAnteHandler(expectedExecution),
Expand Down

0 comments on commit ddf833e

Please sign in to comment.