(t *testing.T)
| 330 | } |
| 331 | |
| 332 | func TestTransactionChainFork(t *testing.T) { |
| 333 | t.Parallel() |
| 334 | |
| 335 | pool, key := setupTxPool() |
| 336 | defer pool.Stop() |
| 337 | |
| 338 | addr := crypto.PubkeyToAddress(key.PublicKey) |
| 339 | resetState := func() { |
| 340 | statedb, _ := state.New(common.Hash{}, state.NewDatabase(database.NewMemDatabase())) |
| 341 | statedb.AddBalance(addr, big.NewInt(100000000000000)) |
| 342 | |
| 343 | pool.chain = &testBlockChain{statedb, 1000000, new(event.Feed)} |
| 344 | pool.lockedReset(nil, nil) |
| 345 | } |
| 346 | resetState() |
| 347 | |
| 348 | tx := transaction(0, 100000, key) |
| 349 | if _, err := pool.add(tx, false); err != nil { |
| 350 | t.Error("didn't expect error", err) |
| 351 | } |
| 352 | pool.removeTx(tx.Hash(), true) |
| 353 | |
| 354 | // reset the pool's internal state |
| 355 | resetState() |
| 356 | if _, err := pool.add(tx, false); err != nil { |
| 357 | t.Error("didn't expect error", err) |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | func TestTransactionDoubleNonce(t *testing.T) { |
| 362 | t.Parallel() |
nothing calls this directly
no test coverage detected