mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
core/txpool/legacypool: fix tests
This commit is contained in:
parent
fada0937cb
commit
3d63770a2b
1 changed files with 4 additions and 4 deletions
|
|
@ -398,7 +398,7 @@ func TestQueue(t *testing.T) {
|
||||||
<-pool.requestReset(nil, nil)
|
<-pool.requestReset(nil, nil)
|
||||||
|
|
||||||
pool.enqueueTx(tx.Hash(), tx, true)
|
pool.enqueueTx(tx.Hash(), tx, true)
|
||||||
<-pool.requestPromoteExecutables(newAccountSet(pool.signer, from))
|
<-pool.requestPromoteExecutables(&reqPromote{newAccountSet(pool.signer, from), make(chan struct{})})
|
||||||
if len(pool.pending) != 1 {
|
if len(pool.pending) != 1 {
|
||||||
t.Error("expected valid txs to be 1 is", len(pool.pending))
|
t.Error("expected valid txs to be 1 is", len(pool.pending))
|
||||||
}
|
}
|
||||||
|
|
@ -408,7 +408,7 @@ func TestQueue(t *testing.T) {
|
||||||
testSetNonce(pool, from, 2)
|
testSetNonce(pool, from, 2)
|
||||||
pool.enqueueTx(tx.Hash(), tx, true)
|
pool.enqueueTx(tx.Hash(), tx, true)
|
||||||
|
|
||||||
<-pool.requestPromoteExecutables(newAccountSet(pool.signer, from))
|
<-pool.requestPromoteExecutables(&reqPromote{newAccountSet(pool.signer, from), make(chan struct{})})
|
||||||
if _, ok := pool.pending[from].txs.items[tx.Nonce()]; ok {
|
if _, ok := pool.pending[from].txs.items[tx.Nonce()]; ok {
|
||||||
t.Error("expected transaction to be in tx pool")
|
t.Error("expected transaction to be in tx pool")
|
||||||
}
|
}
|
||||||
|
|
@ -547,7 +547,7 @@ func TestDoubleNonce(t *testing.T) {
|
||||||
if replace, err := pool.add(tx2); err != nil || !replace {
|
if replace, err := pool.add(tx2); err != nil || !replace {
|
||||||
t.Errorf("second transaction insert failed (%v) or not reported replacement (%v)", err, replace)
|
t.Errorf("second transaction insert failed (%v) or not reported replacement (%v)", err, replace)
|
||||||
}
|
}
|
||||||
<-pool.requestPromoteExecutables(newAccountSet(signer, addr))
|
<-pool.requestPromoteExecutables(&reqPromote{newAccountSet(signer, addr), make(chan struct{})})
|
||||||
if pool.pending[addr].Len() != 1 {
|
if pool.pending[addr].Len() != 1 {
|
||||||
t.Error("expected 1 pending transactions, got", pool.pending[addr].Len())
|
t.Error("expected 1 pending transactions, got", pool.pending[addr].Len())
|
||||||
}
|
}
|
||||||
|
|
@ -557,7 +557,7 @@ func TestDoubleNonce(t *testing.T) {
|
||||||
|
|
||||||
// Add the third transaction and ensure it's not saved (smaller price)
|
// Add the third transaction and ensure it's not saved (smaller price)
|
||||||
pool.add(tx3)
|
pool.add(tx3)
|
||||||
<-pool.requestPromoteExecutables(newAccountSet(signer, addr))
|
<-pool.requestPromoteExecutables(&reqPromote{newAccountSet(signer, addr), make(chan struct{})})
|
||||||
if pool.pending[addr].Len() != 1 {
|
if pool.pending[addr].Len() != 1 {
|
||||||
t.Error("expected 1 pending transactions, got", pool.pending[addr].Len())
|
t.Error("expected 1 pending transactions, got", pool.pending[addr].Len())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue