aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-11-10 18:47:37 +0800
committerobscuren <geffobscura@gmail.com>2014-11-10 18:47:37 +0800
commitd30571a7a84de5a1a3287e764210a3803d7a307f (patch)
tree941126756bb727bf3b02577f38f386ec18e0d372 /vm
parentcbeebcd47da846e1b8990313f1ff1ffe7d0bf00f (diff)
downloadgo-tangerine-d30571a7a84de5a1a3287e764210a3803d7a307f.tar
go-tangerine-d30571a7a84de5a1a3287e764210a3803d7a307f.tar.gz
go-tangerine-d30571a7a84de5a1a3287e764210a3803d7a307f.tar.bz2
go-tangerine-d30571a7a84de5a1a3287e764210a3803d7a307f.tar.lz
go-tangerine-d30571a7a84de5a1a3287e764210a3803d7a307f.tar.xz
go-tangerine-d30571a7a84de5a1a3287e764210a3803d7a307f.tar.zst
go-tangerine-d30571a7a84de5a1a3287e764210a3803d7a307f.zip
Added VM testing tool
Diffstat (limited to 'vm')
-rw-r--r--vm/vm_debug.go3
-rw-r--r--vm/vm_test.go18
2 files changed, 19 insertions, 2 deletions
diff --git a/vm/vm_debug.go b/vm/vm_debug.go
index ce7a29f99..2d34758f5 100644
--- a/vm/vm_debug.go
+++ b/vm/vm_debug.go
@@ -50,8 +50,7 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) {
ret = closure.Return(nil)
err = fmt.Errorf("%v", r)
- // No error should be set. Recover is used with require
- // Is this too error prone?
+
}
}()
}
diff --git a/vm/vm_test.go b/vm/vm_test.go
index f5d77cbff..948dd835f 100644
--- a/vm/vm_test.go
+++ b/vm/vm_test.go
@@ -169,3 +169,21 @@ func TestBuildInRipemd(t *testing.T) {
t.Errorf("Expected %x, got %x", exp, ret)
}
}
+
+func TestOog(t *testing.T) {
+ // This tests takes a long time and will eventually run out of gas
+ //t.Skip()
+
+ logger.AddLogSystem(logger.NewStdLogSystem(os.Stdout, log.LstdFlags, logger.InfoLevel))
+
+ ethutil.ReadConfig(".ethtest", "/tmp/ethtest", "")
+
+ stateObject := state.NewStateObject([]byte{'j', 'e', 'f', 'f'})
+ closure := NewClosure(nil, stateObject, stateObject, ethutil.Hex2Bytes("60ff60ff600057"), big.NewInt(1000000), big.NewInt(0))
+
+ vm := New(TestEnv{}, DebugVmTy)
+ _, _, e := closure.Call(vm, nil)
+ if e != nil {
+ fmt.Println(e)
+ }
+}