aboutsummaryrefslogtreecommitdiffstats
path: root/core/transaction_pool_test.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-22 05:20:27 +0800
committerobscuren <geffobscura@gmail.com>2015-04-23 17:50:11 +0800
commit7138404cb09aebb990fcce589b87173e66355987 (patch)
tree22231a6f9972bf822ce44a58fcafb05ddaafee4e /core/transaction_pool_test.go
parent4feb5f6f9cd5128b4645c1265d814edb443ef43b (diff)
downloadgo-tangerine-7138404cb09aebb990fcce589b87173e66355987.tar
go-tangerine-7138404cb09aebb990fcce589b87173e66355987.tar.gz
go-tangerine-7138404cb09aebb990fcce589b87173e66355987.tar.bz2
go-tangerine-7138404cb09aebb990fcce589b87173e66355987.tar.lz
go-tangerine-7138404cb09aebb990fcce589b87173e66355987.tar.xz
go-tangerine-7138404cb09aebb990fcce589b87173e66355987.tar.zst
go-tangerine-7138404cb09aebb990fcce589b87173e66355987.zip
core: only post event once per tx & fixed test
Diffstat (limited to 'core/transaction_pool_test.go')
-rw-r--r--core/transaction_pool_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/transaction_pool_test.go b/core/transaction_pool_test.go
index 5a5cd866f..0e049139e 100644
--- a/core/transaction_pool_test.go
+++ b/core/transaction_pool_test.go
@@ -67,7 +67,7 @@ func TestTransactionQueue(t *testing.T) {
tx.SignECDSA(key)
from, _ := tx.From()
pool.currentState().AddBalance(from, big.NewInt(1))
- pool.addTx(tx)
+ pool.queueTx(tx)
pool.checkQueue()
if len(pool.txs) != 1 {
@@ -79,7 +79,7 @@ func TestTransactionQueue(t *testing.T) {
from, _ = tx.From()
pool.currentState().SetNonce(from, 10)
tx.SetNonce(1)
- pool.addTx(tx)
+ pool.queueTx(tx)
pool.checkQueue()
if _, ok := pool.txs[tx.Hash()]; ok {
t.Error("expected transaction to be in tx pool")
@@ -96,9 +96,9 @@ func TestTransactionQueue(t *testing.T) {
tx1.SignECDSA(key)
tx2.SignECDSA(key)
tx3.SignECDSA(key)
- pool.addTx(tx1)
- pool.addTx(tx2)
- pool.addTx(tx3)
+ pool.queueTx(tx1)
+ pool.queueTx(tx2)
+ pool.queueTx(tx3)
from, _ = tx1.From()
pool.checkQueue()
@@ -106,7 +106,7 @@ func TestTransactionQueue(t *testing.T) {
t.Error("expected tx pool to be 1 =")
}
- if len(pool.queue[from]) != 2 {
+ if len(pool.queue[from]) != 3 {
t.Error("expected transaction queue to be empty. is", len(pool.queue[from]))
}
}