aboutsummaryrefslogtreecommitdiffstats
path: root/javascript/javascript_runtime.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-07 20:17:48 +0800
committerobscuren <geffobscura@gmail.com>2015-01-07 20:17:48 +0800
commitfed3e6a808921fb8274b50043c5c39a24a1bbccf (patch)
treed632e95cfce78bd9a99a52bf7f30ee3ff980dfd3 /javascript/javascript_runtime.go
parent032ab665299d75bffc25260e8fa477ace19db06a (diff)
downloaddexon-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.gz
dexon-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.zst
dexon-fed3e6a808921fb8274b50043c5c39a24a1bbccf.zip
Refactored ethutil.Config.Db out
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
}