From 7e9ffc49dab24135c3e5b8ef33a76f61e3686204 Mon Sep 17 00:00:00 2001 From: Devon Bear Date: Mon, 2 Oct 2023 15:23:08 -0400 Subject: [PATCH] feat(abci): Add context to SelectedTxs (#17940) (cherry picked from commit ae61dce700e59179a09b527c2d5c48f1ee5a6968) --- baseapp/abci_utils.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/baseapp/abci_utils.go b/baseapp/abci_utils.go index 7803781d9f6b..0b570ab52a69 100644 --- a/baseapp/abci_utils.go +++ b/baseapp/abci_utils.go @@ -215,7 +215,7 @@ func (h *DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHan } } - return &abci.ResponsePrepareProposal{Txs: h.txSelector.SelectedTxs()}, nil + return &abci.ResponsePrepareProposal{Txs: h.txSelector.SelectedTxs(ctx)}, nil } iterator := h.mempool.Select(ctx, req.Txs) @@ -242,7 +242,7 @@ func (h *DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHan iterator = iterator.Next() } - return &abci.ResponsePrepareProposal{Txs: h.txSelector.SelectedTxs()}, nil + return &abci.ResponsePrepareProposal{Txs: h.txSelector.SelectedTxs(ctx)}, nil } } @@ -333,7 +333,7 @@ func NoOpVerifyVoteExtensionHandler() sdk.VerifyVoteExtensionHandler { // track of the selected transactions themselves. type TxSelector interface { // SelectedTxs should return a copy of the selected transactions. - SelectedTxs() [][]byte + SelectedTxs(ctx context.Context) [][]byte // Clear should clear the TxSelector, nulling out all relevant fields. Clear() @@ -355,7 +355,7 @@ func NewDefaultTxSelector() TxSelector { return &defaultTxSelector{} } -func (ts *defaultTxSelector) SelectedTxs() [][]byte { +func (ts *defaultTxSelector) SelectedTxs(_ context.Context) [][]byte { txs := make([][]byte, len(ts.selectedTxs)) copy(txs, ts.selectedTxs) return txs