diff options
author | obscuren <geffobscura@gmail.com> | 2015-01-07 20:17:48 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-01-07 20:17:48 +0800 |
commit | fed3e6a808921fb8274b50043c5c39a24a1bbccf (patch) | |
tree | d632e95cfce78bd9a99a52bf7f30ee3ff980dfd3 /javascript | |
parent | 032ab665299d75bffc25260e8fa477ace19db06a (diff) | |
download | go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.gz go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.zst go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.zip |
Refactored ethutil.Config.Db out
Diffstat (limited to 'javascript')
-rw-r--r-- | javascript/javascript_runtime.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/javascript/javascript_runtime.go b/javascript/javascript_runtime.go index af1405049..adc9022b7 100644 --- a/javascript/javascript_runtime.go +++ b/javascript/javascript_runtime.go @@ -129,10 +129,9 @@ func (self *JSRE) initStdFuncs() { */ func (self *JSRE) dump(call otto.FunctionCall) otto.Value { - var state *state.StateDB + var block *types.Block if len(call.ArgumentList) > 0 { - var block *types.Block if call.Argument(0).IsNumber() { num, _ := call.Argument(0).ToInteger() block = self.ethereum.ChainManager().GetBlockByNumber(uint64(num)) @@ -149,12 +148,12 @@ func (self *JSRE) dump(call otto.FunctionCall) otto.Value { return otto.UndefinedValue() } - state = block.State() } else { - state = self.ethereum.ChainManager().State() + block = self.ethereum.ChainManager().CurrentBlock() } - v, _ := self.Vm.ToValue(state.Dump()) + statedb := state.New(block.Root(), self.ethereum.Db()) + v, _ := self.Vm.ToValue(statedb.Dump()) return v } |