diff options
author | obscuren <geffobscura@gmail.com> | 2014-11-10 19:42:16 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-11-10 19:42:16 +0800 |
commit | ebb7db263ff219eaaacaa2d74d42f69fcd396645 (patch) | |
tree | 2993231bae187bd4702e41b069fd19e66dc7894c /cmd | |
parent | d30571a7a84de5a1a3287e764210a3803d7a307f (diff) | |
download | go-tangerine-ebb7db263ff219eaaacaa2d74d42f69fcd396645.tar go-tangerine-ebb7db263ff219eaaacaa2d74d42f69fcd396645.tar.gz go-tangerine-ebb7db263ff219eaaacaa2d74d42f69fcd396645.tar.bz2 go-tangerine-ebb7db263ff219eaaacaa2d74d42f69fcd396645.tar.lz go-tangerine-ebb7db263ff219eaaacaa2d74d42f69fcd396645.tar.xz go-tangerine-ebb7db263ff219eaaacaa2d74d42f69fcd396645.tar.zst go-tangerine-ebb7db263ff219eaaacaa2d74d42f69fcd396645.zip |
Added dumps
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/evm/main.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cmd/evm/main.go b/cmd/evm/main.go index 984fd6c57..aaff5c796 100644 --- a/cmd/evm/main.go +++ b/cmd/evm/main.go @@ -32,6 +32,7 @@ import ( "runtime" "time" + "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/state" @@ -64,13 +65,18 @@ func main() { tstart := time.Now() - ret, _, e := closure.Call(vm.New(NewVmEnv(), vm.DebugVmTy), nil) + env := NewVmEnv() + ret, _, e := closure.Call(vm.New(env, vm.DebugVmTy), nil) logger.Flush() if e != nil { perr(e) } + if *dump { + fmt.Println(string(env.state.Dump())) + } + var mem runtime.MemStats runtime.ReadMemStats(&mem) fmt.Printf("vm took %v\n", time.Since(tstart)) @@ -90,7 +96,8 @@ type VmEnv struct { } func NewVmEnv() *VmEnv { - return &VmEnv{state.New(trie.New(nil, ""))} + db, _ := ethdb.NewMemDatabase() + return &VmEnv{state.New(trie.New(db, ""))} } func (VmEnv) Origin() []byte { return nil } |