aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-05-25 08:27:37 +0800
committerFelix Lange <fjl@twurst.com>2015-05-25 08:27:37 +0800
commite221a449e069783ca53fd02716066e66baeae1f0 (patch)
tree03b5465f6d71e79b06befede03976f852d9f9058 /rpc
parent394826f520f4c34fe11c8e9dc45c5810024a22e2 (diff)
downloaddexon-e221a449e069783ca53fd02716066e66baeae1f0.tar
dexon-e221a449e069783ca53fd02716066e66baeae1f0.tar.gz
dexon-e221a449e069783ca53fd02716066e66baeae1f0.tar.bz2
dexon-e221a449e069783ca53fd02716066e66baeae1f0.tar.lz
dexon-e221a449e069783ca53fd02716066e66baeae1f0.tar.xz
dexon-e221a449e069783ca53fd02716066e66baeae1f0.tar.zst
dexon-e221a449e069783ca53fd02716066e66baeae1f0.zip
cmd/geth, jsre, rpc: run all JS code on the event loop
Some JSRE methods (PrettyPrint, ToVal) bypassed the event loop. All calls to the JS VM are now wrapped. In order to make this somewhat more foolproof, the otto VM is now a local variable inside the event loop.
Diffstat (limited to 'rpc')
-rw-r--r--rpc/jeth.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/rpc/jeth.go b/rpc/jeth.go
index 2097ac30d..61be60dc7 100644
--- a/rpc/jeth.go
+++ b/rpc/jeth.go
@@ -3,18 +3,18 @@ package rpc
import (
"encoding/json"
"fmt"
+
"github.com/ethereum/go-ethereum/jsre"
"github.com/robertkrimen/otto"
)
type Jeth struct {
ethApi *EthereumApi
- toVal func(interface{}) otto.Value
re *jsre.JSRE
}
-func NewJeth(ethApi *EthereumApi, toVal func(interface{}) otto.Value, re *jsre.JSRE) *Jeth {
- return &Jeth{ethApi, toVal, re}
+func NewJeth(ethApi *EthereumApi, re *jsre.JSRE) *Jeth {
+ return &Jeth{ethApi, re}
}
func (self *Jeth) err(call otto.FunctionCall, code int, msg string, id interface{}) (response otto.Value) {