diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-26 06:42:07 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-26 06:42:07 +0800 |
commit | b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db (patch) | |
tree | 96e360fc19b7c0a37172d6d27d1221bf175228e6 /ethchain/state_object.go | |
parent | 4e1c6a8a22924d06a2a972c024891cebcf8ea054 (diff) | |
parent | 1f3f76cb092e84bd2e90950f0d43d7657eae878e (diff) | |
download | go-tangerine-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.tar go-tangerine-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.tar.gz go-tangerine-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.tar.bz2 go-tangerine-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.tar.lz go-tangerine-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.tar.xz go-tangerine-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.tar.zst go-tangerine-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.zip |
Merge branch 'release/poc5-rc9'
Diffstat (limited to 'ethchain/state_object.go')
-rw-r--r-- | ethchain/state_object.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ethchain/state_object.go b/ethchain/state_object.go index 8e059f334..3e9c6df40 100644 --- a/ethchain/state_object.go +++ b/ethchain/state_object.go @@ -28,8 +28,7 @@ func MakeContract(tx *Transaction, state *State) *StateObject { value := tx.Value contract := NewContract(addr, value, ZeroHash256) - contract.script = tx.Data - contract.initScript = tx.Init + contract.initScript = tx.Data state.UpdateStateObject(contract) @@ -82,12 +81,17 @@ func (c *StateObject) SetStorage(num *big.Int, val *ethutil.Value) { c.SetAddr(addr, val) } -func (c *StateObject) GetMem(num *big.Int) *ethutil.Value { +func (c *StateObject) GetStorage(num *big.Int) *ethutil.Value { nb := ethutil.BigToBytes(num, 256) return c.Addr(nb) } +/* DEPRECATED */ +func (c *StateObject) GetMem(num *big.Int) *ethutil.Value { + return c.GetStorage(num) +} + func (c *StateObject) GetInstr(pc *big.Int) *ethutil.Value { if int64(len(c.script)-1) < pc.Int64() { return ethutil.NewValue(0) @@ -146,7 +150,7 @@ func (c *StateObject) RlpEncode() []byte { if c.state != nil { root = c.state.trie.Root } else { - root = ZeroHash256 + root = "" } return ethutil.Encode([]interface{}{c.Amount, c.Nonce, root, ethutil.Sha3Bin(c.script)}) |