diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-16 18:27:38 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-16 18:27:38 +0800 |
commit | b5234413611ce5984292f85a01de1f56c045b490 (patch) | |
tree | e6e0c6f7fe8358a2dc63cdea11ac66b4f59397f5 /state/statedb.go | |
parent | 0b8f66ed9ef177dc72442dd7ba337c6733e30344 (diff) | |
download | dexon-b5234413611ce5984292f85a01de1f56c045b490.tar dexon-b5234413611ce5984292f85a01de1f56c045b490.tar.gz dexon-b5234413611ce5984292f85a01de1f56c045b490.tar.bz2 dexon-b5234413611ce5984292f85a01de1f56c045b490.tar.lz dexon-b5234413611ce5984292f85a01de1f56c045b490.tar.xz dexon-b5234413611ce5984292f85a01de1f56c045b490.tar.zst dexon-b5234413611ce5984292f85a01de1f56c045b490.zip |
Moved ethutil => common
Diffstat (limited to 'state/statedb.go')
-rw-r--r-- | state/statedb.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/state/statedb.go b/state/statedb.go index a0dc7732f..80bbe2afd 100644 --- a/state/statedb.go +++ b/state/statedb.go @@ -4,7 +4,7 @@ import ( "bytes" "math/big" - "github.com/ethereum/go-ethereum/ethutil" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/trie" ) @@ -17,7 +17,7 @@ var statelogger = logger.NewLogger("STATE") // * Contracts // * Accounts type StateDB struct { - db ethutil.Database + db common.Database trie *trie.SecureTrie stateObjects map[string]*StateObject @@ -28,8 +28,8 @@ type StateDB struct { } // Create a new state from a given trie -func New(root []byte, db ethutil.Database) *StateDB { - trie := trie.NewSecure(ethutil.CopyBytes(root), db) +func New(root []byte, db common.Database) *StateDB { + trie := trie.NewSecure(common.CopyBytes(root), db) return &StateDB{db: db, trie: trie, stateObjects: make(map[string]*StateObject), refund: make(map[string]*big.Int)} } @@ -59,7 +59,7 @@ func (self *StateDB) GetBalance(addr []byte) *big.Int { return stateObject.balance } - return ethutil.Big0 + return common.Big0 } func (self *StateDB) AddBalance(addr []byte, amount *big.Int) { @@ -113,7 +113,7 @@ func (self *StateDB) SetCode(addr, code []byte) { func (self *StateDB) SetState(addr, key []byte, value interface{}) { stateObject := self.GetStateObject(addr) if stateObject != nil { - stateObject.SetState(key, ethutil.NewValue(value)) + stateObject.SetState(key, common.NewValue(value)) } } @@ -161,7 +161,7 @@ func (self *StateDB) DeleteStateObject(stateObject *StateObject) { // Retrieve a state object given my the address. Nil if not found func (self *StateDB) GetStateObject(addr []byte) *StateObject { - addr = ethutil.Address(addr) + addr = common.Address(addr) stateObject := self.stateObjects[string(addr)] if stateObject != nil { @@ -195,7 +195,7 @@ func (self *StateDB) GetOrNewStateObject(addr []byte) *StateObject { // Create a state object whether it exist in the trie or not func (self *StateDB) NewStateObject(addr []byte) *StateObject { - addr = ethutil.Address(addr) + addr = common.Address(addr) statelogger.Debugf("(+) %x\n", addr) |