(t *testing.T)
| 409 | } |
| 410 | |
| 411 | func TestTransactionMissingNonce(t *testing.T) { |
| 412 | t.Parallel() |
| 413 | |
| 414 | pool, key := setupTxPool() |
| 415 | defer pool.Stop() |
| 416 | |
| 417 | addr := crypto.PubkeyToAddress(key.PublicKey) |
| 418 | pool.currentState.AddBalance(addr, big.NewInt(100000000000000)) |
| 419 | tx := transaction(1, 100000, key) |
| 420 | if _, err := pool.add(tx, false); err != nil { |
| 421 | t.Error("didn't expect error", err) |
| 422 | } |
| 423 | if len(pool.pending) != 0 { |
| 424 | t.Error("expected 0 pending transactions, got", len(pool.pending)) |
| 425 | } |
| 426 | if pool.queue[addr].Len() != 1 { |
| 427 | t.Error("expected 1 queued transaction, got", pool.queue[addr].Len()) |
| 428 | } |
| 429 | if pool.all.Count() != 1 { |
| 430 | t.Error("expected 1 total transactions, got", pool.all.Count()) |
| 431 | } |
| 432 | } |
| 433 | |
| 434 | func TestTransactionNonceRecovery(t *testing.T) { |
| 435 | t.Parallel() |
nothing calls this directly
no test coverage detected