diff options
author | obscuren <geffobscura@gmail.com> | 2014-04-26 08:06:25 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-04-26 08:06:25 +0800 |
commit | ca6e3f6defae958cece52ee7d26ca1b53b0adebb (patch) | |
tree | 470f09eafcdf31f3081be654498e8f1877dc9ee7 /ethchain/vm.go | |
parent | d3a159ad3d6842ffb137fc1df48a54703345faa4 (diff) | |
download | dexon-ca6e3f6defae958cece52ee7d26ca1b53b0adebb.tar dexon-ca6e3f6defae958cece52ee7d26ca1b53b0adebb.tar.gz dexon-ca6e3f6defae958cece52ee7d26ca1b53b0adebb.tar.bz2 dexon-ca6e3f6defae958cece52ee7d26ca1b53b0adebb.tar.lz dexon-ca6e3f6defae958cece52ee7d26ca1b53b0adebb.tar.xz dexon-ca6e3f6defae958cece52ee7d26ca1b53b0adebb.tar.zst dexon-ca6e3f6defae958cece52ee7d26ca1b53b0adebb.zip |
Notify of changes
Diffstat (limited to 'ethchain/vm.go')
-rw-r--r-- | ethchain/vm.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ethchain/vm.go b/ethchain/vm.go index 93557007d..a4b4d351b 100644 --- a/ethchain/vm.go +++ b/ethchain/vm.go @@ -56,8 +56,6 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro // Recover from any require exception defer func() { if r := recover(); r != nil /*&& isRequireError*/ { - fmt.Println(r) - ret = closure.Return(nil) err = fmt.Errorf("%v", r) fmt.Println("vm err", err) @@ -158,7 +156,6 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro x, y := stack.Popn() // (x + y) % 2 ** 256 base.Add(x, y) - fmt.Println(x, y, base) // Pop result back on the stack stack.Push(base) case oSUB: @@ -321,7 +318,6 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro require(1) offset := stack.Pop().Int64() val := closure.Args[offset : offset+32] - fmt.Println(ethutil.BigD(val)) stack.Push(ethutil.BigD(val)) case oCALLDATASIZE: @@ -394,7 +390,6 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro require(1) loc := stack.Pop() val := closure.GetMem(loc) - fmt.Printf("load %x = %v\n", loc.Bytes(), val.BigInt()) stack.Push(val.BigInt()) case oSSTORE: require(2) @@ -452,8 +447,12 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro ret, err := closure.Call(vm, args, hook) if err != nil { stack.Push(ethutil.BigFalse) + // Reset the changes applied this object + //contract.State().Reset() } else { stack.Push(ethutil.BigTrue) + // Notify of the changes + vm.stateManager.Changed(contract) } mem.Set(retOffset.Int64(), retSize.Int64(), ret) |