diff options
Diffstat (limited to 'core/transaction_pool_test.go')
-rw-r--r-- | core/transaction_pool_test.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/core/transaction_pool_test.go b/core/transaction_pool_test.go index 2e1debfbe..7f192fc4d 100644 --- a/core/transaction_pool_test.go +++ b/core/transaction_pool_test.go @@ -6,16 +6,22 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/state" ) // State query interface -type stateQuery struct{} +type stateQuery struct{ db ethutil.Database } + +func SQ() stateQuery { + db, _ := ethdb.NewMemDatabase() + return stateQuery{db: db} +} func (self stateQuery) GetAccount(addr []byte) *state.StateObject { - return state.NewStateObject(addr) + return state.NewStateObject(addr, self.db) } func transaction() *types.Transaction { @@ -66,7 +72,7 @@ func TestRemoveInvalid(t *testing.T) { pool, key := setup() tx1 := transaction() pool.addTx(tx1) - pool.RemoveInvalid(stateQuery{}) + pool.RemoveInvalid(SQ()) if pool.Size() > 0 { t.Error("expected pool size to be 0") } @@ -74,7 +80,7 @@ func TestRemoveInvalid(t *testing.T) { tx1.SetNonce(1) tx1.SignECDSA(key) pool.addTx(tx1) - pool.RemoveInvalid(stateQuery{}) + pool.RemoveInvalid(SQ()) if pool.Size() != 1 { t.Error("expected pool size to be 1, is", pool.Size()) } |