diff options
author | obscuren <geffobscura@gmail.com> | 2014-03-21 06:38:16 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-03-21 06:38:16 +0800 |
commit | f567f89b994bf28f908410223084a6702d05d156 (patch) | |
tree | 1ec45639e8ec6787d1d97ec59c2bd78a7f90d9b0 /ethchain/vm.go | |
parent | 7705b23f248156878d00c301fbbadafedaf7e3d2 (diff) | |
download | go-tangerine-f567f89b994bf28f908410223084a6702d05d156.tar go-tangerine-f567f89b994bf28f908410223084a6702d05d156.tar.gz go-tangerine-f567f89b994bf28f908410223084a6702d05d156.tar.bz2 go-tangerine-f567f89b994bf28f908410223084a6702d05d156.tar.lz go-tangerine-f567f89b994bf28f908410223084a6702d05d156.tar.xz go-tangerine-f567f89b994bf28f908410223084a6702d05d156.tar.zst go-tangerine-f567f89b994bf28f908410223084a6702d05d156.zip |
Added address to account and contract
Contract and account now both have an address field or method for the
sake of simplicity.
Diffstat (limited to 'ethchain/vm.go')
-rw-r--r-- | ethchain/vm.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ethchain/vm.go b/ethchain/vm.go index 3d85e2c09..ba19231cc 100644 --- a/ethchain/vm.go +++ b/ethchain/vm.go @@ -23,14 +23,12 @@ type Vm struct { } type RuntimeVars struct { - address []byte + origin []byte blockNumber uint64 - sender []byte prevHash []byte coinbase []byte time int64 diff *big.Int - txValue *big.Int txData []string } @@ -108,6 +106,7 @@ func (vm *Vm) RunClosure(closure *Closure) []byte { closure := NewClosure(closure, contract, vm.state, gas, value) // Executer the closure and get the return value (if any) ret := closure.Call(vm, nil) + mem.Set(retOffset.Int64(), retSize.Int64(), ret) case oRETURN: size, offset := stack.Popn() @@ -501,7 +500,7 @@ func makeInlineTx(addr []byte, value, from, length *big.Int, contract *Contract, tx := NewTransaction(addr, value, dataItems) if tx.IsContract() { contract := MakeContract(tx, state) - state.UpdateContract(tx.Hash()[12:], contract) + state.UpdateContract(contract) } else { account := state.GetAccount(tx.Recipient) account.Amount.Add(account.Amount, tx.Value) |