aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/jeth.go
diff options
context:
space:
mode:
authorBas van Kervel <bas@ethdev.com>2015-06-22 18:47:32 +0800
committerBas van Kervel <bas@ethdev.com>2015-06-22 18:47:32 +0800
commit2e0b56a72b3eafc89938003da29c06496ac9ad4e (patch)
treeeba3eb3a822da0ba7de98d9c7b6dc8601a63db0a /rpc/jeth.go
parent2737baa6577a337f33f020d587af100c9bda3585 (diff)
downloadgo-tangerine-2e0b56a72b3eafc89938003da29c06496ac9ad4e.tar
go-tangerine-2e0b56a72b3eafc89938003da29c06496ac9ad4e.tar.gz
go-tangerine-2e0b56a72b3eafc89938003da29c06496ac9ad4e.tar.bz2
go-tangerine-2e0b56a72b3eafc89938003da29c06496ac9ad4e.tar.lz
go-tangerine-2e0b56a72b3eafc89938003da29c06496ac9ad4e.tar.xz
go-tangerine-2e0b56a72b3eafc89938003da29c06496ac9ad4e.tar.zst
go-tangerine-2e0b56a72b3eafc89938003da29c06496ac9ad4e.zip
added RPC start/stop support
Diffstat (limited to 'rpc/jeth.go')
-rw-r--r--rpc/jeth.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/rpc/jeth.go b/rpc/jeth.go
index e656e8fa9..33fcd6efd 100644
--- a/rpc/jeth.go
+++ b/rpc/jeth.go
@@ -4,25 +4,24 @@ import (
"encoding/json"
"github.com/ethereum/go-ethereum/jsre"
- "github.com/ethereum/go-ethereum/rpc/api"
"github.com/ethereum/go-ethereum/rpc/comms"
"github.com/ethereum/go-ethereum/rpc/shared"
"github.com/robertkrimen/otto"
)
type Jeth struct {
- ethApi api.EthereumApi
+ ethApi shared.EthereumApi
re *jsre.JSRE
client comms.EthereumClient
}
-func NewJeth(ethApi api.EthereumApi, re *jsre.JSRE, client comms.EthereumClient) *Jeth {
+func NewJeth(ethApi shared.EthereumApi, re *jsre.JSRE, client comms.EthereumClient) *Jeth {
return &Jeth{ethApi, re, client}
}
func (self *Jeth) err(call otto.FunctionCall, code int, msg string, id interface{}) (response otto.Value) {
rpcerr := &shared.ErrorObject{code, msg}
- call.Otto.Set("ret_jsonrpc", api.JsonRpcVersion)
+ call.Otto.Set("ret_jsonrpc", shared.JsonRpcVersion)
call.Otto.Set("ret_id", id)
call.Otto.Set("ret_error", rpcerr)
response, _ = call.Otto.Run(`
@@ -61,7 +60,7 @@ func (self *Jeth) Send(call otto.FunctionCall) (response otto.Value) {
return self.err(call, -32603, err.Error(), req.Id)
}
- call.Otto.Set("ret_jsonrpc", api.JsonRpcVersion)
+ call.Otto.Set("ret_jsonrpc", shared.JsonRpcVersion)
call.Otto.Set("ret_id", req.Id)
res, _ := json.Marshal(respif)