55 "fmt"
66 "math/big"
77
8- "github.com/ethereum/go-ethereum/ethcrypto "
8+ "github.com/ethereum/go-ethereum/crypto "
99 "github.com/ethereum/go-ethereum/ethstate"
1010 "github.com/ethereum/go-ethereum/ethutil"
1111 "github.com/obscuren/secp256k1-go"
@@ -66,7 +66,7 @@ func (self *Transaction) TotalValue() *big.Int {
6666func (tx * Transaction ) Hash () []byte {
6767 data := []interface {}{tx .Nonce , tx .GasPrice , tx .Gas , tx .Recipient , tx .Value , tx .Data }
6868
69- return ethcrypto .Sha3 (ethutil .NewValue (data ).Encode ())
69+ return crypto .Sha3 (ethutil .NewValue (data ).Encode ())
7070}
7171
7272func (tx * Transaction ) CreatesContract () bool {
@@ -80,9 +80,9 @@ func (tx *Transaction) IsContract() bool {
8080
8181func (tx * Transaction ) CreationAddress (state * ethstate.State ) []byte {
8282 // Generate a new address
83- addr := ethcrypto .Sha3 (ethutil .NewValue ([]interface {}{tx .Sender (), tx .Nonce }).Encode ())[12 :]
83+ addr := crypto .Sha3 (ethutil .NewValue ([]interface {}{tx .Sender (), tx .Nonce }).Encode ())[12 :]
8484 //for i := uint64(0); state.GetStateObject(addr) != nil; i++ {
85- // addr = ethcrypto .Sha3(ethutil.NewValue([]interface{}{tx.Sender(), tx.Nonce + i}).Encode())[12:]
85+ // addr = crypto .Sha3(ethutil.NewValue([]interface{}{tx.Sender(), tx.Nonce + i}).Encode())[12:]
8686 //}
8787
8888 return addr
@@ -106,7 +106,7 @@ func (tx *Transaction) PublicKey() []byte {
106106 sig := append (r , s ... )
107107 sig = append (sig , tx .v - 27 )
108108
109- pubkey := ethcrypto .Ecrecover (append (hash , sig ... ))
109+ pubkey := crypto .Ecrecover (append (hash , sig ... ))
110110 //pubkey, _ := secp256k1.RecoverPubkey(hash, sig)
111111
112112 return pubkey
@@ -121,7 +121,7 @@ func (tx *Transaction) Sender() []byte {
121121 return nil
122122 }
123123
124- return ethcrypto .Sha3 (pubkey [1 :])[12 :]
124+ return crypto .Sha3 (pubkey [1 :])[12 :]
125125}
126126
127127func (tx * Transaction ) Sign (privk []byte ) error {
0 commit comments