aboutsummaryrefslogtreecommitdiffstats
path: root/core/tx_pool_test.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2019-07-09 16:02:13 +0800
committerGitHub <noreply@github.com>2019-07-09 16:02:13 +0800
commit8c249cb82f713c5c5b5a8160c92da7fe145e799d (patch)
tree9afff7cb13fc9a4e1f893b9c29a5baa7d714681a /core/tx_pool_test.go
parent5873c01c3d777c315f75df8b9934c580d43d2b3b (diff)
parenta966425a1de080a907356494db5c0302614a3cb5 (diff)
downloadgo-tangerine-8c249cb82f713c5c5b5a8160c92da7fe145e799d.tar
go-tangerine-8c249cb82f713c5c5b5a8160c92da7fe145e799d.tar.gz
go-tangerine-8c249cb82f713c5c5b5a8160c92da7fe145e799d.tar.bz2
go-tangerine-8c249cb82f713c5c5b5a8160c92da7fe145e799d.tar.lz
go-tangerine-8c249cb82f713c5c5b5a8160c92da7fe145e799d.tar.xz
go-tangerine-8c249cb82f713c5c5b5a8160c92da7fe145e799d.tar.zst
go-tangerine-8c249cb82f713c5c5b5a8160c92da7fe145e799d.zip
Merge pull request #19810 from karalabe/txpool-noncer
core: kill off managed state, use own tiny noncer for txpool
Diffstat (limited to 'core/tx_pool_test.go')
-rw-r--r--core/tx_pool_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/tx_pool_test.go b/core/tx_pool_test.go
index 7f1832a43..7df1a2c6f 100644
--- a/core/tx_pool_test.go
+++ b/core/tx_pool_test.go
@@ -109,7 +109,7 @@ func validateTxPoolInternals(pool *TxPool) error {
last = nonce
}
}
- if nonce := pool.pendingState.GetNonce(addr); nonce != last+1 {
+ if nonce := pool.Nonce(addr); nonce != last+1 {
return fmt.Errorf("pending nonce mismatch: have %v, want %v", nonce, last+1)
}
}
@@ -195,14 +195,14 @@ func TestStateChangeDuringTransactionPoolReset(t *testing.T) {
pool := NewTxPool(testTxPoolConfig, params.TestChainConfig, blockchain)
defer pool.Stop()
- nonce := pool.State().GetNonce(address)
+ nonce := pool.Nonce(address)
if nonce != 0 {
t.Fatalf("Invalid nonce, want 0, got %d", nonce)
}
pool.addRemotesSync([]*types.Transaction{tx0, tx1})
- nonce = pool.State().GetNonce(address)
+ nonce = pool.Nonce(address)
if nonce != 2 {
t.Fatalf("Invalid nonce, want 2, got %d", nonce)
}
@@ -215,7 +215,7 @@ func TestStateChangeDuringTransactionPoolReset(t *testing.T) {
if err != nil {
t.Fatalf("Could not fetch pending transactions: %v", err)
}
- nonce = pool.State().GetNonce(address)
+ nonce = pool.Nonce(address)
if nonce != 2 {
t.Fatalf("Invalid nonce, want 2, got %d", nonce)
}
@@ -451,7 +451,7 @@ func TestTransactionNonceRecovery(t *testing.T) {
// simulate some weird re-order of transactions and missing nonce(s)
pool.currentState.SetNonce(addr, n-1)
<-pool.requestReset(nil, nil)
- if fn := pool.pendingState.GetNonce(addr); fn != n-1 {
+ if fn := pool.Nonce(addr); fn != n-1 {
t.Errorf("expected nonce to be %d, got %d", n-1, fn)
}
}