From ddf833e1a6e6b7917e254dade65c1153c13fef84 Mon Sep 17 00:00:00 2001 From: David Terpay Date: Wed, 6 Dec 2023 14:51:37 -0500 Subject: [PATCH] merge conflict --- abci/abci.go | 14 +------------- abci/abci_test.go | 8 ++++---- abci/utils_test.go | 10 +++++----- lanes/base/abci_test.go | 2 +- lanes/mev/mev_test.go | 2 +- 5 files changed, 12 insertions(+), 24 deletions(-) diff --git a/abci/abci.go b/abci/abci.go index 0b2bbf3d..ce2a2117 100644 --- a/abci/abci.go +++ b/abci/abci.go @@ -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 diff --git a/abci/abci_test.go b/abci/abci_test.go index 8eafdc81..8e9c6971 100644 --- a/abci/abci_test.go +++ b/abci/abci_test.go @@ -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, @@ -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, @@ -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, @@ -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, diff --git a/abci/utils_test.go b/abci/utils_test.go index 3dccd2f6..bf298b0f 100644 --- a/abci/utils_test.go +++ b/abci/utils_test.go @@ -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), @@ -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), @@ -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), @@ -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, diff --git a/lanes/base/abci_test.go b/lanes/base/abci_test.go index 5801e414..9fb4b789 100644 --- a/lanes/base/abci_test.go +++ b/lanes/base/abci_test.go @@ -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), diff --git a/lanes/mev/mev_test.go b/lanes/mev/mev_test.go index 3d9eb00c..ea500c22 100644 --- a/lanes/mev/mev_test.go +++ b/lanes/mev/mev_test.go @@ -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),