aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/state_object.go
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2014-06-30 01:30:05 +0800
committerzelig <viktor.tron@gmail.com>2014-06-30 01:30:05 +0800
commitdabaa4cce01586fd8b1b9314073a1d26f35355c8 (patch)
treefff48b2c62a1d717a7d95ffb99e9eb1d99dbf7bb /ethchain/state_object.go
parent707d413761927f5ad95298e666e297b820ad0901 (diff)
downloadgo-tangerine-dabaa4cce01586fd8b1b9314073a1d26f35355c8.tar.gz
go-tangerine-dabaa4cce01586fd8b1b9314073a1d26f35355c8.tar.zst
go-tangerine-dabaa4cce01586fd8b1b9314073a1d26f35355c8.zip
change all modified calls to ethtrie, ethutil and ethcrypto functions
Diffstat (limited to 'ethchain/state_object.go')
-rw-r--r--ethchain/state_object.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/ethchain/state_object.go b/ethchain/state_object.go
index 480b4055d..e55540153 100644
--- a/ethchain/state_object.go
+++ b/ethchain/state_object.go
@@ -2,6 +2,8 @@ package ethchain
import (
"fmt"
+ "github.com/ethereum/eth-go/ethcrypto"
+ "github.com/ethereum/eth-go/ethtrie"
"github.com/ethereum/eth-go/ethutil"
"math/big"
"strings"
@@ -39,7 +41,7 @@ func MakeContract(tx *Transaction, state *State) *StateObject {
contract := state.NewStateObject(addr)
contract.initScript = tx.Data
- contract.state = NewState(ethutil.NewTrie(ethutil.Config.Db, ""))
+ contract.state = NewState(ethtrie.NewTrie(ethutil.Config.Db, ""))
return contract
}
@@ -53,7 +55,7 @@ func NewStateObject(addr []byte) *StateObject {
func NewContract(address []byte, Amount *big.Int, root []byte) *StateObject {
contract := &StateObject{address: address, Amount: Amount, Nonce: 0}
- contract.state = NewState(ethutil.NewTrie(ethutil.Config.Db, string(root)))
+ contract.state = NewState(ethtrie.NewTrie(ethutil.Config.Db, string(root)))
return contract
}
@@ -246,7 +248,7 @@ func (c *StateObject) RlpEncode() []byte {
root = ""
}
- return ethutil.Encode([]interface{}{c.Nonce, c.Amount, root, ethutil.Sha3Bin(c.script)})
+ return ethutil.Encode([]interface{}{c.Nonce, c.Amount, root, ethcrypto.Sha3Bin(c.script)})
}
func (c *StateObject) RlpDecode(data []byte) {
@@ -254,7 +256,8 @@ func (c *StateObject) RlpDecode(data []byte) {
c.Nonce = decoder.Get(0).Uint()
c.Amount = decoder.Get(1).BigInt()
- c.state = NewState(ethutil.NewTrie(ethutil.Config.Db, decoder.Get(2).Interface()))
+ c.state = NewState(ethtrie.NewTrie(ethutil.Config.Db, decoder.Get(2).Interface()))
+ c.state = NewState(ethtrie.NewTrie(ethutil.Config.Db, decoder.Get(2).Interface()))
c.ScriptHash = decoder.Get(3).Bytes()