Skip to content

Commit f42e261

Browse files
committed
add dummy param to ReapMaxBytesMaxTxs
1 parent 9042a3e commit f42e261

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

internal/consensus/mempool_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func TestMempoolRmBadTx(t *testing.T) {
230230

231231
// check for the tx
232232
for {
233-
txs := assertMempool(t, cs.txNotifier).ReapMaxBytesMaxGas(int64(len(txBytes)), -1, 0)
233+
txs := assertMempool(t, cs.txNotifier).ReapMaxBytesMaxGas(int64(len(txBytes)), 0, -1, 0)
234234
if len(txs) == 0 {
235235
emptyMempoolCh <- struct{}{}
236236
return

internal/consensus/replay_stubs.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ func (emptyMempool) Size() int { return 0 }
3333
func (emptyMempool) CheckTx(context.Context, types.Tx, func(*abci.ResponseCheckTx), mempool.TxInfo) error {
3434
return nil
3535
}
36-
func (emptyMempool) RemoveTxByKey(txKey types.TxKey) error { return nil }
37-
func (emptyMempool) ReapMaxBytesMaxGas(_, _, _ int64) types.Txs { return types.Txs{} }
38-
func (emptyMempool) ReapMaxTxs(n int) types.Txs { return types.Txs{} }
36+
func (emptyMempool) RemoveTxByKey(txKey types.TxKey) error { return nil }
37+
func (emptyMempool) ReapMaxBytesMaxGas(_, _, _, _ int64) types.Txs { return types.Txs{} }
38+
func (emptyMempool) ReapMaxTxs(n int) types.Txs { return types.Txs{} }
3939
func (emptyMempool) Update(
4040
_ context.Context,
4141
_ int64,

internal/mempool/mempool.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ func (txmp *TxMempool) Flush() {
432432
// NOTE:
433433
// - Transactions returned are not removed from the mempool transaction
434434
// store or indexes.
435-
func (txmp *TxMempool) ReapMaxBytesMaxGas(maxBytes, maxGas, minTxsInBlock int64) types.Txs {
435+
func (txmp *TxMempool) ReapMaxBytesMaxGas(maxBytes, _, maxGas, minTxsInBlock int64) types.Txs {
436436
txmp.mtx.Lock()
437437
defer txmp.mtx.Unlock()
438438

internal/mempool/mempool_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ func TestTxMempool_ReapMaxBytesMaxGas(t *testing.T) {
407407
wg.Add(1)
408408
go func() {
409409
defer wg.Done()
410-
reapedTxs := txmp.ReapMaxBytesMaxGas(-1, 50, 0)
410+
reapedTxs := txmp.ReapMaxBytesMaxGas(-1, 0, 50, 0)
411411
ensurePrioritized(reapedTxs)
412412
require.Equal(t, len(tTxs), txmp.Size())
413413
require.Equal(t, int64(5690), txmp.SizeBytes())
@@ -418,7 +418,7 @@ func TestTxMempool_ReapMaxBytesMaxGas(t *testing.T) {
418418
wg.Add(1)
419419
go func() {
420420
defer wg.Done()
421-
reapedTxs := txmp.ReapMaxBytesMaxGas(1000, -1, 0)
421+
reapedTxs := txmp.ReapMaxBytesMaxGas(1000, 0, -1, 0)
422422
ensurePrioritized(reapedTxs)
423423
require.Equal(t, len(tTxs), txmp.Size())
424424
require.Equal(t, int64(5690), txmp.SizeBytes())
@@ -430,7 +430,7 @@ func TestTxMempool_ReapMaxBytesMaxGas(t *testing.T) {
430430
wg.Add(1)
431431
go func() {
432432
defer wg.Done()
433-
reapedTxs := txmp.ReapMaxBytesMaxGas(1500, 30, 0)
433+
reapedTxs := txmp.ReapMaxBytesMaxGas(1500, 0, 30, 0)
434434
ensurePrioritized(reapedTxs)
435435
require.Equal(t, len(tTxs), txmp.Size())
436436
require.Equal(t, int64(5690), txmp.SizeBytes())
@@ -441,7 +441,7 @@ func TestTxMempool_ReapMaxBytesMaxGas(t *testing.T) {
441441
wg.Add(1)
442442
go func() {
443443
defer wg.Done()
444-
reapedTxs := txmp.ReapMaxBytesMaxGas(-1, 1, 2)
444+
reapedTxs := txmp.ReapMaxBytesMaxGas(-1, 0, 1, 2)
445445
ensurePrioritized(reapedTxs)
446446
require.Equal(t, len(tTxs), txmp.Size())
447447
require.Len(t, reapedTxs, 2)
@@ -451,7 +451,7 @@ func TestTxMempool_ReapMaxBytesMaxGas(t *testing.T) {
451451
wg.Add(1)
452452
go func() {
453453
defer wg.Done()
454-
reapedTxs := txmp.ReapMaxBytesMaxGas(-1, 50, 0)
454+
reapedTxs := txmp.ReapMaxBytesMaxGas(-1, 0, 50, 0)
455455
ensurePrioritized(reapedTxs)
456456
require.Equal(t, len(tTxs), txmp.Size())
457457
require.Len(t, reapedTxs, 50)

internal/mempool/mocks/mempool.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/mempool/types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type Mempool interface {
4848
//
4949
// If all 3 maxes are negative, there is no cap on the size of all returned
5050
// transactions (~ all available transactions).
51-
ReapMaxBytesMaxGas(maxBytes, maxGas, minTxsInBlock int64) types.Txs
51+
ReapMaxBytesMaxGas(maxBytes, maxGasWanted, maxGas, minTxsInBlock int64) types.Txs
5252

5353
// ReapMaxTxs reaps up to max transactions from the mempool. If max is
5454
// negative, there is no cap on the size of all returned transactions

internal/state/execution.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
101101
// Fetch a limited amount of valid txs
102102
maxDataBytes := types.MaxDataBytes(maxBytes, evSize, state.Validators.Size())
103103

104-
txs := blockExec.mempool.ReapMaxBytesMaxGas(maxDataBytes, maxGas, state.ConsensusParams.Block.MinTxsInBlock)
104+
txs := blockExec.mempool.ReapMaxBytesMaxGas(maxDataBytes, 0, maxGas, state.ConsensusParams.Block.MinTxsInBlock)
105105
commit := lastExtCommit.ToCommit()
106106
block := state.MakeBlock(height, txs, commit, evidence, proposerAddr)
107107
rpp, err := blockExec.appClient.PrepareProposal(

0 commit comments

Comments
 (0)