diff options
author | Felix Lange <fjl@twurst.com> | 2015-03-18 20:38:47 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-03-18 20:38:47 +0800 |
commit | a59dd393e71cc52b1f96973aef884af619166f38 (patch) | |
tree | b52cfbbb41a9fffaaefa2bc8913f578480cff160 /core/transaction_pool_test.go | |
parent | b5b83db450974f70f4bc25f280cc6ec9193f8e19 (diff) | |
download | dexon-a59dd393e71cc52b1f96973aef884af619166f38.tar.gz dexon-a59dd393e71cc52b1f96973aef884af619166f38.tar.zst dexon-a59dd393e71cc52b1f96973aef884af619166f38.zip |
core: fix tests
Diffstat (limited to 'core/transaction_pool_test.go')
-rw-r--r-- | core/transaction_pool_test.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/core/transaction_pool_test.go b/core/transaction_pool_test.go index 418cb0415..bf9012573 100644 --- a/core/transaction_pool_test.go +++ b/core/transaction_pool_test.go @@ -4,10 +4,10 @@ import ( "crypto/ecdsa" "testing" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/state" ) @@ -21,11 +21,11 @@ func SQ() stateQuery { } func (self stateQuery) GetAccount(addr []byte) *state.StateObject { - return state.NewStateObject(addr, self.db) + return state.NewStateObject(common.BytesToAddress(addr), self.db) } func transaction() *types.Transaction { - return types.NewTransactionMessage(make([]byte, 20), common.Big0, common.Big0, common.Big0, nil) + return types.NewTransactionMessage(common.Address{}, common.Big0, common.Big0, common.Big0, nil) } func setup() (*TxPool, *ecdsa.PrivateKey) { @@ -88,10 +88,8 @@ func TestRemoveInvalid(t *testing.T) { func TestInvalidSender(t *testing.T) { pool, _ := setup() - tx := new(types.Transaction) - tx.V = 28 - err := pool.ValidateTransaction(tx) + err := pool.ValidateTransaction(new(types.Transaction)) if err != ErrInvalidSender { - t.Error("expected %v, got %v", ErrInvalidSender, err) + t.Errorf("expected %v, got %v", ErrInvalidSender, err) } } |