diff options
author | obscuren <geffobscura@gmail.com> | 2014-04-30 20:43:32 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-04-30 20:43:32 +0800 |
commit | 21724f7ef960f0f2df0d2b0f3cccfd030a4aaee8 (patch) | |
tree | 6d19b52ecde07314bc6f3a156df47c81d94c9b35 /ethchain/vm.go | |
parent | 38d6b67b5cfbfb63620a244ea01b5b534917128f (diff) | |
download | go-tangerine-21724f7ef960f0f2df0d2b0f3cccfd030a4aaee8.tar go-tangerine-21724f7ef960f0f2df0d2b0f3cccfd030a4aaee8.tar.gz go-tangerine-21724f7ef960f0f2df0d2b0f3cccfd030a4aaee8.tar.bz2 go-tangerine-21724f7ef960f0f2df0d2b0f3cccfd030a4aaee8.tar.lz go-tangerine-21724f7ef960f0f2df0d2b0f3cccfd030a4aaee8.tar.xz go-tangerine-21724f7ef960f0f2df0d2b0f3cccfd030a4aaee8.tar.zst go-tangerine-21724f7ef960f0f2df0d2b0f3cccfd030a4aaee8.zip |
Added manifest changes and changed closures
Diffstat (limited to 'ethchain/vm.go')
-rw-r--r-- | ethchain/vm.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ethchain/vm.go b/ethchain/vm.go index b983e88ff..0a3690c41 100644 --- a/ethchain/vm.go +++ b/ethchain/vm.go @@ -411,6 +411,9 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro require(2) val, loc := stack.Popn() closure.SetMem(loc, ethutil.NewValue(val)) + + // Add the change to manifest + vm.stateManager.manifest.AddStorageChange(closure.Object(), loc.Bytes(), val) case oJUMP: require(1) pc = stack.Pop() @@ -492,7 +495,7 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro } closure.Gas.Sub(closure.Gas, gas) // Create a new callable closure - closure := NewClosure(closure, contract, contract.script, vm.state, gas, closure.Price, value) + closure := NewClosure(closure.Object(), contract, contract.script, vm.state, gas, closure.Price, value) // Executer the closure and get the return value (if any) ret, err := closure.Call(vm, args, hook) if err != nil { @@ -502,7 +505,7 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro } else { stack.Push(ethutil.BigTrue) // Notify of the changes - vm.stateManager.Changed(contract) + vm.stateManager.manifest.AddObjectChange(contract) } mem.Set(retOffset.Int64(), retSize.Int64(), ret) |