diff options
author | obscuren <geffobscura@gmail.com> | 2014-08-04 16:38:18 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-08-04 16:38:18 +0800 |
commit | 3debeb7236d2c8474fa9049cc91dc26bf1040b3f (patch) | |
tree | 928b5ff8486ea485a3efae8cc69adaf54af9c87e /ethstate/state_object.go | |
parent | 2e7cf835222274a311302c33498cf83bb2593b7a (diff) | |
download | dexon-3debeb7236d2c8474fa9049cc91dc26bf1040b3f.tar dexon-3debeb7236d2c8474fa9049cc91dc26bf1040b3f.tar.gz dexon-3debeb7236d2c8474fa9049cc91dc26bf1040b3f.tar.bz2 dexon-3debeb7236d2c8474fa9049cc91dc26bf1040b3f.tar.lz dexon-3debeb7236d2c8474fa9049cc91dc26bf1040b3f.tar.xz dexon-3debeb7236d2c8474fa9049cc91dc26bf1040b3f.tar.zst dexon-3debeb7236d2c8474fa9049cc91dc26bf1040b3f.zip |
ethtrie.NewTrie => ethtrie.New
Diffstat (limited to 'ethstate/state_object.go')
-rw-r--r-- | ethstate/state_object.go | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/ethstate/state_object.go b/ethstate/state_object.go index 5932fbee6..309e3e762 100644 --- a/ethstate/state_object.go +++ b/ethstate/state_object.go @@ -57,30 +57,12 @@ func (self *StateObject) Reset() { self.State.Reset() } -/* -// Converts an transaction in to a state object -func MakeContract(tx *Transaction, state *State) *StateObject { - // Create contract if there's no recipient - if tx.IsContract() { - addr := tx.CreationAddress() - - contract := state.NewStateObject(addr) - contract.initCode = tx.Data - contract.state = NewState(ethtrie.NewTrie(ethutil.Config.Db, "")) - - return contract - } - - return nil -} -*/ - func NewStateObject(addr []byte) *StateObject { // This to ensure that it has 20 bytes (and not 0 bytes), thus left or right pad doesn't matter. address := ethutil.Address(addr) object := &StateObject{address: address, Balance: new(big.Int), gasPool: new(big.Int)} - object.State = NewState(ethtrie.NewTrie(ethutil.Config.Db, "")) + object.State = NewState(ethtrie.New(ethutil.Config.Db, "")) object.storage = make(Storage) object.gasPool = new(big.Int) @@ -90,7 +72,7 @@ func NewStateObject(addr []byte) *StateObject { func NewContract(address []byte, balance *big.Int, root []byte) *StateObject { contract := NewStateObject(address) contract.Balance = balance - contract.State = NewState(ethtrie.NewTrie(ethutil.Config.Db, string(root))) + contract.State = NewState(ethtrie.New(ethutil.Config.Db, string(root))) return contract } @@ -318,7 +300,7 @@ func (c *StateObject) RlpDecode(data []byte) { c.Nonce = decoder.Get(0).Uint() c.Balance = decoder.Get(1).BigInt() - c.State = NewState(ethtrie.NewTrie(ethutil.Config.Db, decoder.Get(2).Interface())) + c.State = NewState(ethtrie.New(ethutil.Config.Db, decoder.Get(2).Interface())) c.storage = make(map[string]*ethutil.Value) c.gasPool = new(big.Int) |