aboutsummaryrefslogtreecommitdiffstats
path: root/javascript/javascript_runtime.go
diff options
context:
space:
mode:
Diffstat (limited to 'javascript/javascript_runtime.go')
-rw-r--r--javascript/javascript_runtime.go9
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
}