@@ -164,7 +164,7 @@ func setupPoolWithConfig(config *params.ChainConfig) (*LegacyPool, *ecdsa.Privat
164164
165165 key , _ := crypto .GenerateKey ()
166166 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 {
168168 panic (err )
169169 }
170170 // wait for the pool to initialize
@@ -199,9 +199,6 @@ func validatePoolInternals(pool *LegacyPool) error {
199199 if nonce := pool .pendingNonces .get (addr ); nonce != last + 1 {
200200 return fmt .Errorf ("pending nonce mismatch: have %v, want %v" , nonce , last + 1 )
201201 }
202- if txs .totalcost .Cmp (common .Big0 ) < 0 {
203- return fmt .Errorf ("totalcost went negative: %v" , txs .totalcost )
204- }
205202 }
206203 return nil
207204}
@@ -283,7 +280,7 @@ func TestStateChangeDuringReset(t *testing.T) {
283280 tx1 := transaction (1 , 100000 , key )
284281
285282 pool := New (testTxPoolConfig , blockchain )
286- pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
283+ pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
287284 defer pool .Close ()
288285
289286 nonce := pool .Nonce (address )
@@ -349,7 +346,7 @@ func TestInvalidTransactions(t *testing.T) {
349346 }
350347
351348 tx = transaction (1 , 100000 , key )
352- pool .gasTip .Store (big .NewInt (1000 ))
349+ pool .gasTip .Store (uint256 .NewInt (1000 ))
353350 if err , want := pool .addRemote (tx ), txpool .ErrUnderpriced ; ! errors .Is (err , want ) {
354351 t .Errorf ("want %v have %v" , want , err )
355352 }
@@ -703,7 +700,7 @@ func TestPostponing(t *testing.T) {
703700 blockchain := newTestBlockChain (params .TestChainConfig , 1000000 , statedb , new (event.Feed ))
704701
705702 pool := New (testTxPoolConfig , blockchain )
706- pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
703+ pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
707704 defer pool .Close ()
708705
709706 // Create two test accounts to produce different gap profiles with
@@ -920,7 +917,7 @@ func testQueueGlobalLimiting(t *testing.T, nolocals bool) {
920917 config .GlobalQueue = config .AccountQueue * 3 - 1 // reduce the queue limits to shorten test time (-1 to make it non divisible)
921918
922919 pool := New (config , blockchain )
923- pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
920+ pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
924921 defer pool .Close ()
925922
926923 // 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) {
10131010 config .NoLocals = nolocals
10141011
10151012 pool := New (config , blockchain )
1016- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1013+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
10171014 defer pool .Close ()
10181015
10191016 // Create two test accounts to ensure remotes expire but locals do not
@@ -1198,7 +1195,7 @@ func TestPendingGlobalLimiting(t *testing.T) {
11981195 config .GlobalSlots = config .AccountSlots * 10
11991196
12001197 pool := New (config , blockchain )
1201- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1198+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
12021199 defer pool .Close ()
12031200
12041201 // Create a number of test accounts and fund them
@@ -1302,7 +1299,7 @@ func TestCapClearsFromAll(t *testing.T) {
13021299 config .GlobalSlots = 8
13031300
13041301 pool := New (config , blockchain )
1305- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1302+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
13061303 defer pool .Close ()
13071304
13081305 // Create a number of test accounts and fund them
@@ -1335,7 +1332,7 @@ func TestPendingMinimumAllowance(t *testing.T) {
13351332 config .GlobalSlots = 1
13361333
13371334 pool := New (config , blockchain )
1338- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1335+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
13391336 defer pool .Close ()
13401337
13411338 // Create a number of test accounts and fund them
@@ -1381,7 +1378,7 @@ func TestRepricing(t *testing.T) {
13811378 blockchain := newTestBlockChain (params .TestChainConfig , 1000000 , statedb , new (event.Feed ))
13821379
13831380 pool := New (testTxPoolConfig , blockchain )
1384- pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1381+ pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
13851382 defer pool .Close ()
13861383
13871384 // Keep track of transaction events to ensure all executables get announced
@@ -1503,7 +1500,7 @@ func TestMinGasPriceEnforced(t *testing.T) {
15031500 txPoolConfig := DefaultConfig
15041501 txPoolConfig .NoLocals = true
15051502 pool := New (txPoolConfig , blockchain )
1506- pool .Init (new (big. Int ). SetUint64 ( txPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1503+ pool .Init (txPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
15071504 defer pool .Close ()
15081505
15091506 key , _ := crypto .GenerateKey ()
@@ -1674,7 +1671,7 @@ func TestRepricingKeepsLocals(t *testing.T) {
16741671 blockchain := newTestBlockChain (eip1559Config , 1000000 , statedb , new (event.Feed ))
16751672
16761673 pool := New (testTxPoolConfig , blockchain )
1677- pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1674+ pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
16781675 defer pool .Close ()
16791676
16801677 // Create a number of test accounts and fund them
@@ -1752,7 +1749,7 @@ func TestUnderpricing(t *testing.T) {
17521749 config .GlobalQueue = 2
17531750
17541751 pool := New (config , blockchain )
1755- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1752+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
17561753 defer pool .Close ()
17571754
17581755 // Keep track of transaction events to ensure all executables get announced
@@ -1867,7 +1864,7 @@ func TestStableUnderpricing(t *testing.T) {
18671864 config .GlobalQueue = 0
18681865
18691866 pool := New (config , blockchain )
1870- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
1867+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
18711868 defer pool .Close ()
18721869
18731870 // Keep track of transaction events to ensure all executables get announced
@@ -2096,7 +2093,7 @@ func TestDeduplication(t *testing.T) {
20962093 blockchain := newTestBlockChain (params .TestChainConfig , 1000000 , statedb , new (event.Feed ))
20972094
20982095 pool := New (testTxPoolConfig , blockchain )
2099- pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
2096+ pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
21002097 defer pool .Close ()
21012098
21022099 // Create a test account to add transactions with
@@ -2163,7 +2160,7 @@ func TestReplacement(t *testing.T) {
21632160 blockchain := newTestBlockChain (params .TestChainConfig , 1000000 , statedb , new (event.Feed ))
21642161
21652162 pool := New (testTxPoolConfig , blockchain )
2166- pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
2163+ pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
21672164 defer pool .Close ()
21682165
21692166 // Keep track of transaction events to ensure all executables get announced
@@ -2374,7 +2371,7 @@ func testJournaling(t *testing.T, nolocals bool) {
23742371 config .Rejournal = time .Second
23752372
23762373 pool := New (config , blockchain )
2377- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
2374+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
23782375
23792376 // Create two test accounts to ensure remotes expire but locals do not
23802377 local , _ := crypto .GenerateKey ()
@@ -2412,7 +2409,7 @@ func testJournaling(t *testing.T, nolocals bool) {
24122409 blockchain = newTestBlockChain (params .TestChainConfig , 1000000 , statedb , new (event.Feed ))
24132410
24142411 pool = New (config , blockchain )
2415- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
2412+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
24162413
24172414 pending , queued = pool .Stats ()
24182415 if queued != 0 {
@@ -2439,7 +2436,7 @@ func testJournaling(t *testing.T, nolocals bool) {
24392436 statedb .SetNonce (crypto .PubkeyToAddress (local .PublicKey ), 1 )
24402437 blockchain = newTestBlockChain (params .TestChainConfig , 1000000 , statedb , new (event.Feed ))
24412438 pool = New (config , blockchain )
2442- pool .Init (new (big. Int ). SetUint64 ( config .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
2439+ pool .Init (config .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
24432440
24442441 pending , queued = pool .Stats ()
24452442 if pending != 0 {
@@ -2470,7 +2467,7 @@ func TestStatusCheck(t *testing.T) {
24702467 blockchain := newTestBlockChain (params .TestChainConfig , 1000000 , statedb , new (event.Feed ))
24712468
24722469 pool := New (testTxPoolConfig , blockchain )
2473- pool .Init (new (big. Int ). SetUint64 ( testTxPoolConfig .PriceLimit ) , blockchain .CurrentBlock (), makeAddressReserver ())
2470+ pool .Init (testTxPoolConfig .PriceLimit , blockchain .CurrentBlock (), makeAddressReserver ())
24742471 defer pool .Close ()
24752472
24762473 // Create the test accounts to check various transaction statuses with
0 commit comments