@@ -1411,34 +1411,34 @@ func TestTransactionReplacement(t *testing.T) {
1411
1411
if err := pool .AddRemote (pricedTransaction (0 , big .NewInt (100000 ), big .NewInt (price ), key )); err != nil {
1412
1412
t .Fatalf ("failed to add original proper pending transaction: %v" , err )
1413
1413
}
1414
- if err := pool .AddRemote (pricedTransaction (0 , big .NewInt (100000 ), big .NewInt (threshold ), key )); err != ErrReplaceUnderpriced {
1414
+ if err := pool .AddRemote (pricedTransaction (0 , big .NewInt (100001 ), big .NewInt (threshold - 1 ), key )); err != ErrReplaceUnderpriced {
1415
1415
t .Fatalf ("original proper pending transaction replacement error mismatch: have %v, want %v" , err , ErrReplaceUnderpriced )
1416
1416
}
1417
- if err := pool .AddRemote (pricedTransaction (0 , big .NewInt (100000 ), big .NewInt (threshold + 1 ), key )); err != nil {
1417
+ if err := pool .AddRemote (pricedTransaction (0 , big .NewInt (100000 ), big .NewInt (threshold ), key )); err != nil {
1418
1418
t .Fatalf ("failed to replace original proper pending transaction: %v" , err )
1419
1419
}
1420
1420
if err := validateEvents (events , 2 ); err != nil {
1421
1421
t .Fatalf ("proper replacement event firing failed: %v" , err )
1422
1422
}
1423
1423
// Add queued transactions, ensuring the minimum price bump is enforced for replacement (for ultra low prices too)
1424
1424
if err := pool .AddRemote (pricedTransaction (2 , big .NewInt (100000 ), big .NewInt (1 ), key )); err != nil {
1425
- t .Fatalf ("failed to add original queued transaction: %v" , err )
1425
+ t .Fatalf ("failed to add original cheap queued transaction: %v" , err )
1426
1426
}
1427
1427
if err := pool .AddRemote (pricedTransaction (2 , big .NewInt (100001 ), big .NewInt (1 ), key )); err != ErrReplaceUnderpriced {
1428
- t .Fatalf ("original queued transaction replacement error mismatch: have %v, want %v" , err , ErrReplaceUnderpriced )
1428
+ t .Fatalf ("original cheap queued transaction replacement error mismatch: have %v, want %v" , err , ErrReplaceUnderpriced )
1429
1429
}
1430
1430
if err := pool .AddRemote (pricedTransaction (2 , big .NewInt (100000 ), big .NewInt (2 ), key )); err != nil {
1431
- t .Fatalf ("failed to replace original queued transaction: %v" , err )
1431
+ t .Fatalf ("failed to replace original cheap queued transaction: %v" , err )
1432
1432
}
1433
1433
1434
1434
if err := pool .AddRemote (pricedTransaction (2 , big .NewInt (100000 ), big .NewInt (price ), key )); err != nil {
1435
- t .Fatalf ("failed to add original queued transaction: %v" , err )
1435
+ t .Fatalf ("failed to add original proper queued transaction: %v" , err )
1436
1436
}
1437
- if err := pool .AddRemote (pricedTransaction (2 , big .NewInt (100001 ), big .NewInt (threshold ), key )); err != ErrReplaceUnderpriced {
1438
- t .Fatalf ("original queued transaction replacement error mismatch: have %v, want %v" , err , ErrReplaceUnderpriced )
1437
+ if err := pool .AddRemote (pricedTransaction (2 , big .NewInt (100001 ), big .NewInt (threshold - 1 ), key )); err != ErrReplaceUnderpriced {
1438
+ t .Fatalf ("original proper queued transaction replacement error mismatch: have %v, want %v" , err , ErrReplaceUnderpriced )
1439
1439
}
1440
- if err := pool .AddRemote (pricedTransaction (2 , big .NewInt (100000 ), big .NewInt (threshold + 1 ), key )); err != nil {
1441
- t .Fatalf ("failed to replace original queued transaction: %v" , err )
1440
+ if err := pool .AddRemote (pricedTransaction (2 , big .NewInt (100000 ), big .NewInt (threshold ), key )); err != nil {
1441
+ t .Fatalf ("failed to replace original proper queued transaction: %v" , err )
1442
1442
}
1443
1443
1444
1444
if err := validateEvents (events , 0 ); err != nil {
0 commit comments