Skip to content

Commit

Permalink
Problem: mempool.GasTx interface is not reused (cosmos#536)
Browse files Browse the repository at this point in the history
* Problem: redundant mutex for InsertWithGasWanted

cfg of PriorityNonceMempool remains unchanged once assigned, so no lock is required

* make mocks

* cleanup

* keep order of check MaxTx
  • Loading branch information
mmsqe authored Jul 2, 2024
1 parent 36295f0 commit 52a97a8
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 27 deletions.
4 changes: 1 addition & 3 deletions baseapp/abci_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,7 @@ func (h *DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHan
}

var txGasLimit uint64
if gasTx, ok := tx.(interface {
GetGas() uint64
}); ok {
if gasTx, ok := tx.(mempool.GasTx); ok {
txGasLimit = gasTx.GetGas()
}

Expand Down
15 changes: 7 additions & 8 deletions baseapp/testutil/mock/mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 35 additions & 16 deletions x/gov/testutil/expected_keepers_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 52a97a8

Please sign in to comment.