aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/vm.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-07-16 02:35:55 +0800
committerobscuren <geffobscura@gmail.com>2014-07-16 02:35:55 +0800
commit7a410643ac5dc7cc297cbdb094539761230440d0 (patch)
tree13e3c43b517639510ccb54451daa7e04073f45ca /ethchain/vm.go
parent34da3b4fa8133a2042919fe344b7bc656fcad4f2 (diff)
downloadgo-tangerine-7a410643ac5dc7cc297cbdb094539761230440d0.tar
go-tangerine-7a410643ac5dc7cc297cbdb094539761230440d0.tar.gz
go-tangerine-7a410643ac5dc7cc297cbdb094539761230440d0.tar.bz2
go-tangerine-7a410643ac5dc7cc297cbdb094539761230440d0.tar.lz
go-tangerine-7a410643ac5dc7cc297cbdb094539761230440d0.tar.xz
go-tangerine-7a410643ac5dc7cc297cbdb094539761230440d0.tar.zst
go-tangerine-7a410643ac5dc7cc297cbdb094539761230440d0.zip
Added/changed logging
Diffstat (limited to 'ethchain/vm.go')
-rw-r--r--ethchain/vm.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/ethchain/vm.go b/ethchain/vm.go
index 788bde886..3a956ee83 100644
--- a/ethchain/vm.go
+++ b/ethchain/vm.go
@@ -155,6 +155,15 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
// XXX Leave this Println intact. Don't change this to the log system.
// Used for creating diffs between implementations
if vm.logTy == LogTyDiff {
+ switch op {
+ case STOP, RETURN, SUICIDE:
+ closure.object.Sync()
+ closure.object.state.EachStorage(func(key string, value *ethutil.Value) {
+ value.Decode()
+ fmt.Printf("%x %x\n", new(big.Int).SetBytes([]byte(key)).Bytes(), value.Bytes())
+ })
+ }
+
b := pc.Bytes()
if len(b) == 0 {
b = []byte{0}
@@ -184,7 +193,6 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
var mult *big.Int
y, x := stack.Peekn()
val := closure.GetStorage(x)
- //if val.IsEmpty() && len(y.Bytes()) > 0 {
if val.BigInt().Cmp(ethutil.Big0) == 0 && len(y.Bytes()) > 0 {
mult = ethutil.Big2
} else if !val.IsEmpty() && len(y.Bytes()) == 0 {