core: fix tests

This commit is contained in:
Felix Lange
2015-03-18 13:38:47 +01:00
parent b5b83db450
commit a59dd393e7
5 changed files with 13 additions and 19 deletions

View File

@ -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)
}
}