pull/3969/head
Rongjian Lan 3 years ago
parent 07c63c27c0
commit 014c8f5e98
  1. 10
      core/tx_pool_test.go

@ -577,7 +577,7 @@ func TestTransactionChainFork(t *testing.T) {
addr := crypto.PubkeyToAddress(key.PublicKey)
resetState := func() {
statedb, _ := state.New(common.Hash{}, state.NewDatabase(rawdb.NewMemoryDatabase()))
statedb.AddBalance(addr, big.NewInt(90000000000000000000))
statedb.AddBalance(addr, big.NewInt(9000000000000000000))
pool.chain = &testBlockChain{statedb, 1000000, new(event.Feed)}
pool.lockedReset(nil, nil)
@ -606,7 +606,7 @@ func TestTransactionDoubleNonce(t *testing.T) {
addr := crypto.PubkeyToAddress(key.PublicKey)
resetState := func() {
statedb, _ := state.New(common.Hash{}, state.NewDatabase(rawdb.NewMemoryDatabase()))
statedb.AddBalance(addr, big.NewInt(10000000000000000000))
statedb.AddBalance(addr, big.NewInt(1000000000000000000))
pool.chain = &testBlockChain{statedb, 1000000, new(event.Feed)}
pool.lockedReset(nil, nil)
@ -1123,7 +1123,7 @@ func testTransactionLimitingEquivalency(t *testing.T, origin uint64) {
defer pool1.Stop()
account1, _ := deriveSender(transaction(0, 0, 0, key1))
pool1.currentState.AddBalance(account1, big.NewInt(90000000000000000000))
pool1.currentState.AddBalance(account1, big.NewInt(9000000000000000000))
for i := uint64(0); i < testTxPoolConfig.AccountQueue+5; i++ {
if err := pool1.AddRemote(transaction(0, origin+i, 100000, key1)); err != nil {
@ -1135,7 +1135,7 @@ func testTransactionLimitingEquivalency(t *testing.T, origin uint64) {
defer pool2.Stop()
account2, _ := deriveSender(transaction(0, 0, 0, key2))
pool2.currentState.AddBalance(account2, big.NewInt(90000000000000000000))
pool2.currentState.AddBalance(account2, big.NewInt(9000000000000000000))
txs := types.PoolTransactions{}
for i := uint64(0); i < testTxPoolConfig.AccountQueue+5; i++ {
@ -1475,7 +1475,7 @@ func TestTransactionStatusCheck(t *testing.T) {
keys := make([]*ecdsa.PrivateKey, 3)
for i := 0; i < len(keys); i++ {
keys[i], _ = crypto.GenerateKey()
pool.currentState.AddBalance(crypto.PubkeyToAddress(keys[i].PublicKey), big.NewInt(90000000000000000000))
pool.currentState.AddBalance(crypto.PubkeyToAddress(keys[i].PublicKey), big.NewInt(9000000000000000000))
}
// Generate and queue a batch of transactions, both pending and queued
txs := types.PoolTransactions{}

Loading…
Cancel
Save