aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/state_object.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-26 06:42:07 +0800
committerobscuren <geffobscura@gmail.com>2014-05-26 06:42:07 +0800
commitb1463b2dc23ebd072f5e1e2c9a74842fc7ff51db (patch)
tree96e360fc19b7c0a37172d6d27d1221bf175228e6 /ethchain/state_object.go
parent4e1c6a8a22924d06a2a972c024891cebcf8ea054 (diff)
parent1f3f76cb092e84bd2e90950f0d43d7657eae878e (diff)
downloaddexon-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.tar.gz
dexon-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.tar.zst
dexon-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.zip
Merge branch 'release/poc5-rc9'
Diffstat (limited to 'ethchain/state_object.go')
-rw-r--r--ethchain/state_object.go12
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)})