55 "math/big"
66
77 "github.com/ethereum/go-ethereum/crypto"
8- "github.com/ethereum/go-ethereum/ethtrie"
98 "github.com/ethereum/go-ethereum/ethutil"
9+ "github.com/ethereum/go-ethereum/trie"
1010)
1111
1212type Code []byte
@@ -62,7 +62,7 @@ func NewStateObject(addr []byte) *StateObject {
6262 address := ethutil .Address (addr )
6363
6464 object := & StateObject {address : address , balance : new (big.Int ), gasPool : new (big.Int )}
65- object .State = New (ethtrie .New (ethutil .Config .Db , "" ))
65+ object .State = New (trie .New (ethutil .Config .Db , "" ))
6666 object .storage = make (Storage )
6767 object .gasPool = new (big.Int )
6868
@@ -72,7 +72,7 @@ func NewStateObject(addr []byte) *StateObject {
7272func NewContract (address []byte , balance * big.Int , root []byte ) * StateObject {
7373 contract := NewStateObject (address )
7474 contract .balance = balance
75- contract .State = New (ethtrie .New (ethutil .Config .Db , string (root )))
75+ contract .State = New (trie .New (ethutil .Config .Db , string (root )))
7676
7777 return contract
7878}
@@ -129,7 +129,7 @@ func (self *StateObject) SetState(k []byte, value *ethutil.Value) {
129129}
130130
131131// Iterate over each storage address and yield callback
132- func (self * StateObject ) EachStorage (cb ethtrie .EachCallback ) {
132+ func (self * StateObject ) EachStorage (cb trie .EachCallback ) {
133133 // First loop over the uncommit/cached values in storage
134134 for key , value := range self .storage {
135135 // XXX Most iterators Fns as it stands require encoded values
@@ -158,7 +158,7 @@ func (self *StateObject) Sync() {
158158 self .SetAddr ([]byte (key ), value )
159159 }
160160
161- valid , t2 := ethtrie .ParanoiaCheck (self .State .Trie )
161+ valid , t2 := trie .ParanoiaCheck (self .State .Trie )
162162 if ! valid {
163163 statelogger .Infof ("Warn: PARANOIA: Different state storage root during copy %x vs %x\n " , self .State .Trie .Root , t2 .Root )
164164
@@ -321,7 +321,7 @@ func (c *StateObject) RlpDecode(data []byte) {
321321
322322 c .Nonce = decoder .Get (0 ).Uint ()
323323 c .balance = decoder .Get (1 ).BigInt ()
324- c .State = New (ethtrie .New (ethutil .Config .Db , decoder .Get (2 ).Interface ()))
324+ c .State = New (trie .New (ethutil .Config .Db , decoder .Get (2 ).Interface ()))
325325 c .storage = make (map [string ]* ethutil.Value )
326326 c .gasPool = new (big.Int )
327327
0 commit comments