Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(abci): Add context to SelectedTxs #17940

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions baseapp/abci_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}
}

Expand Down Expand Up @@ -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()
Expand All @@ -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
Expand Down