Skip to content

Commit

Permalink
feat(abci): Add context to SelectedTxs (#17940)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdevbear authored Oct 2, 2023
1 parent a68a02a commit ae61dce
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit ae61dce

Please sign in to comment.