@@ -446,6 +446,7 @@ func TestTxMempool_ReapMaxBytesMaxGas(t *testing.T) {
446
446
require .Len (t , reapedTxs , 2 )
447
447
}()
448
448
449
+ // Reap by max gas estimated
449
450
wg .Add (1 )
450
451
go func () {
451
452
defer wg .Done ()
@@ -455,6 +456,28 @@ func TestTxMempool_ReapMaxBytesMaxGas(t *testing.T) {
455
456
require .Len (t , reapedTxs , 50 )
456
457
}()
457
458
459
+ // Test that minTxsPerBlock is still used even when max gas esimated is exceeded
460
+ wg .Add (1 )
461
+ go func () {
462
+ defer wg .Done ()
463
+ // pull minTxsPerBlock even though max gas wanted is hit
464
+ reapedTxs := txmp .ReapMaxBytesMaxGas (- 1 , - 1 , 50 , 51 )
465
+ ensurePrioritized (reapedTxs )
466
+ require .Equal (t , len (tTxs ), txmp .Size ())
467
+ require .Len (t , reapedTxs , 51 )
468
+ }()
469
+
470
+ // Test that minTxsPerBlock is still used even when max gas wanted is exceeded
471
+ wg .Add (1 )
472
+ go func () {
473
+ defer wg .Done ()
474
+ // pull minTxsPerBlock even though max gas wanted is hit
475
+ reapedTxs := txmp .ReapMaxBytesMaxGas (- 1 , 50 , - 1 , 51 )
476
+ ensurePrioritized (reapedTxs )
477
+ require .Equal (t , len (tTxs ), txmp .Size ())
478
+ require .Len (t , reapedTxs , 51 )
479
+ }()
480
+
458
481
wg .Wait ()
459
482
}
460
483
0 commit comments