@@ -164,7 +164,7 @@ func setupPoolWithConfig(config *params.ChainConfig) (*LegacyPool, *ecdsa.Privat
164
164
165
165
key , _ := crypto .GenerateKey ()
166
166
pool := New (testTxPoolConfig , blockchain )
167
- if err := pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ()); err != nil {
167
+ if err := pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ()); err != nil {
168
168
panic (err )
169
169
}
170
170
// wait for the pool to initialize
@@ -199,9 +199,6 @@ func validatePoolInternals(pool *LegacyPool) error {
199
199
if nonce := pool .pendingNonces .get (addr ); nonce != last + 1 {
200
200
return fmt .Errorf ("pending nonce mismatch: have %v, want %v" , nonce , last + 1 )
201
201
}
202
- if txs .totalcost .Cmp (common .Big0 ) < 0 {
203
- return fmt .Errorf ("totalcost went negative: %v" , txs .totalcost )
204
- }
205
202
}
206
203
return nil
207
204
}
@@ -283,7 +280,7 @@ func TestStateChangeDuringReset(t *testing.T) {
283
280
tx1 := transaction (1 , 100000 , key )
284
281
285
282
pool := New (testTxPoolConfig , blockchain )
286
- pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
283
+ pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
287
284
defer pool .Close ()
288
285
289
286
nonce := pool .Nonce (address )
@@ -349,7 +346,7 @@ func TestInvalidTransactions(t *testing.T) {
349
346
}
350
347
351
348
tx = transaction (1 , 100000 , key )
352
- pool .gasTip .Store (big .NewInt (1000 ))
349
+ pool .gasTip .Store (uint256 .NewInt (1000 ))
353
350
if err , want := pool .addRemote (tx ), txpool .ErrUnderpriced ; ! errors .Is (err , want ) {
354
351
t .Errorf ("want %v have %v" , want , err )
355
352
}
@@ -703,7 +700,7 @@ func TestPostponing(t *testing.T) {
703
700
blockchain := newTestBlockChain (params .TestChainConfig , 1000000 , statedb , new (event.Feed ))
704
701
705
702
pool := New (testTxPoolConfig , blockchain )
706
- pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
703
+ pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
707
704
defer pool .Close ()
708
705
709
706
// Create two test accounts to produce different gap profiles with
@@ -920,7 +917,7 @@ func testQueueGlobalLimiting(t *testing.T, nolocals bool) {
920
917
config .GlobalQueue = config .AccountQueue * 3 - 1 // reduce the queue limits to shorten test time (-1 to make it non divisible)
921
918
922
919
pool := New (config , blockchain )
923
- pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
920
+ pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
924
921
defer pool .Close ()
925
922
926
923
// Create a number of test accounts and fund them (last one will be the local)
@@ -1013,7 +1010,7 @@ func testQueueTimeLimiting(t *testing.T, nolocals bool) {
1013
1010
config .NoLocals = nolocals
1014
1011
1015
1012
pool := New (config , blockchain )
1016
- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1013
+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
1017
1014
defer pool .Close ()
1018
1015
1019
1016
// Create two test accounts to ensure remotes expire but locals do not
@@ -1198,7 +1195,7 @@ func TestPendingGlobalLimiting(t *testing.T) {
1198
1195
config .GlobalSlots = config .AccountSlots * 10
1199
1196
1200
1197
pool := New (config , blockchain )
1201
- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1198
+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
1202
1199
defer pool .Close ()
1203
1200
1204
1201
// Create a number of test accounts and fund them
@@ -1302,7 +1299,7 @@ func TestCapClearsFromAll(t *testing.T) {
1302
1299
config .GlobalSlots = 8
1303
1300
1304
1301
pool := New (config , blockchain )
1305
- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1302
+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
1306
1303
defer pool .Close ()
1307
1304
1308
1305
// Create a number of test accounts and fund them
@@ -1335,7 +1332,7 @@ func TestPendingMinimumAllowance(t *testing.T) {
1335
1332
config .GlobalSlots = 1
1336
1333
1337
1334
pool := New (config , blockchain )
1338
- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1335
+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
1339
1336
defer pool .Close ()
1340
1337
1341
1338
// Create a number of test accounts and fund them
@@ -1381,7 +1378,7 @@ func TestRepricing(t *testing.T) {
1381
1378
blockchain := newTestBlockChain (params .TestChainConfig , 1000000 , statedb , new (event.Feed ))
1382
1379
1383
1380
pool := New (testTxPoolConfig , blockchain )
1384
- pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1381
+ pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
1385
1382
defer pool .Close ()
1386
1383
1387
1384
// Keep track of transaction events to ensure all executables get announced
@@ -1503,7 +1500,7 @@ func TestMinGasPriceEnforced(t *testing.T) {
1503
1500
txPoolConfig := DefaultConfig
1504
1501
txPoolConfig .NoLocals = true
1505
1502
pool := New (txPoolConfig , blockchain )
1506
- pool .Init (new (big. Int ). SetUint64 ( txPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1503
+ pool .Init (txPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
1507
1504
defer pool .Close ()
1508
1505
1509
1506
key , _ := crypto .GenerateKey ()
@@ -1674,7 +1671,7 @@ func TestRepricingKeepsLocals(t *testing.T) {
1674
1671
blockchain := newTestBlockChain (eip1559Config , 1000000 , statedb , new (event.Feed ))
1675
1672
1676
1673
pool := New (testTxPoolConfig , blockchain )
1677
- pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1674
+ pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
1678
1675
defer pool .Close ()
1679
1676
1680
1677
// Create a number of test accounts and fund them
@@ -1752,7 +1749,7 @@ func TestUnderpricing(t *testing.T) {
1752
1749
config .GlobalQueue = 2
1753
1750
1754
1751
pool := New (config , blockchain )
1755
- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1752
+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
1756
1753
defer pool .Close ()
1757
1754
1758
1755
// Keep track of transaction events to ensure all executables get announced
@@ -1867,7 +1864,7 @@ func TestStableUnderpricing(t *testing.T) {
1867
1864
config .GlobalQueue = 0
1868
1865
1869
1866
pool := New (config , blockchain )
1870
- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1867
+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
1871
1868
defer pool .Close ()
1872
1869
1873
1870
// Keep track of transaction events to ensure all executables get announced
@@ -2096,7 +2093,7 @@ func TestDeduplication(t *testing.T) {
2096
2093
blockchain := newTestBlockChain (params .TestChainConfig , 1000000 , statedb , new (event.Feed ))
2097
2094
2098
2095
pool := New (testTxPoolConfig , blockchain )
2099
- pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
2096
+ pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
2100
2097
defer pool .Close ()
2101
2098
2102
2099
// Create a test account to add transactions with
@@ -2163,7 +2160,7 @@ func TestReplacement(t *testing.T) {
2163
2160
blockchain := newTestBlockChain (params .TestChainConfig , 1000000 , statedb , new (event.Feed ))
2164
2161
2165
2162
pool := New (testTxPoolConfig , blockchain )
2166
- pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
2163
+ pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
2167
2164
defer pool .Close ()
2168
2165
2169
2166
// Keep track of transaction events to ensure all executables get announced
@@ -2374,7 +2371,7 @@ func testJournaling(t *testing.T, nolocals bool) {
2374
2371
config .Rejournal = time .Second
2375
2372
2376
2373
pool := New (config , blockchain )
2377
- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
2374
+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
2378
2375
2379
2376
// Create two test accounts to ensure remotes expire but locals do not
2380
2377
local , _ := crypto .GenerateKey ()
@@ -2412,7 +2409,7 @@ func testJournaling(t *testing.T, nolocals bool) {
2412
2409
blockchain = newTestBlockChain (params .TestChainConfig , 1000000 , statedb , new (event.Feed ))
2413
2410
2414
2411
pool = New (config , blockchain )
2415
- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
2412
+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
2416
2413
2417
2414
pending , queued = pool .Stats ()
2418
2415
if queued != 0 {
@@ -2439,7 +2436,7 @@ func testJournaling(t *testing.T, nolocals bool) {
2439
2436
statedb .SetNonce (crypto .PubkeyToAddress (local .PublicKey ), 1 )
2440
2437
blockchain = newTestBlockChain (params .TestChainConfig , 1000000 , statedb , new (event.Feed ))
2441
2438
pool = New (config , blockchain )
2442
- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
2439
+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
2443
2440
2444
2441
pending , queued = pool .Stats ()
2445
2442
if pending != 0 {
@@ -2470,7 +2467,7 @@ func TestStatusCheck(t *testing.T) {
2470
2467
blockchain := newTestBlockChain (params .TestChainConfig , 1000000 , statedb , new (event.Feed ))
2471
2468
2472
2469
pool := New (testTxPoolConfig , blockchain )
2473
- pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
2470
+ pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
2474
2471
defer pool .Close ()
2475
2472
2476
2473
// Create the test accounts to check various transaction statuses with
0 commit comments