diff options
author | obscuren <geffobscura@gmail.com> | 2015-01-29 01:36:41 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-01-29 01:36:41 +0800 |
commit | 1c51e12c181fb781cafaf34fc8dd2cb07fd85df7 (patch) | |
tree | 38465edc586ae8080018f37efa8657c7dfeab6af /rpc | |
parent | 45e15f62f594d6f5191e60a54aead33602838e98 (diff) | |
parent | 872b2497114209119becf2e8a4d4a5818e2084ee (diff) | |
download | dexon-1c51e12c181fb781cafaf34fc8dd2cb07fd85df7.tar.gz dexon-1c51e12c181fb781cafaf34fc8dd2cb07fd85df7.tar.zst dexon-1c51e12c181fb781cafaf34fc8dd2cb07fd85df7.zip |
Merge branch 'jsonrpc' into qt5.4
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/http/server.go | 4 | ||||
-rw-r--r-- | rpc/packages.go | 10 | ||||
-rw-r--r-- | rpc/ws/server.go | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/rpc/http/server.go b/rpc/http/server.go index 2a492f465..965727a4e 100644 --- a/rpc/http/server.go +++ b/rpc/http/server.go @@ -29,7 +29,7 @@ import ( var rpchttplogger = logger.NewLogger("RPC-HTTP") var JSON rpc.JsonWrapper -func NewRpcHttpServer(pipe *xeth.JSXEth, port int) (*RpcHttpServer, error) { +func NewRpcHttpServer(pipe *xeth.XEth, port int) (*RpcHttpServer, error) { sport := fmt.Sprintf(":%d", port) l, err := net.Listen("tcp", sport) if err != nil { @@ -47,7 +47,7 @@ func NewRpcHttpServer(pipe *xeth.JSXEth, port int) (*RpcHttpServer, error) { type RpcHttpServer struct { quit chan bool listener net.Listener - pipe *xeth.JSXEth + pipe *xeth.XEth port int } diff --git a/rpc/packages.go b/rpc/packages.go index e6d4859d2..700b9b2b3 100644 --- a/rpc/packages.go +++ b/rpc/packages.go @@ -19,8 +19,8 @@ For each request type, define the following: 1. RpcRequest "To" method [message.go], which does basic validation and conversion to "Args" type via json.Decoder() -2. json.Decoder() calls "UnmarshalJSON" defined on each "Args" struct -3. EthereumApi method, taking the "Args" type and replying with an interface to be marshalled to JSON +2. json.Decoder() calls "UnmarshalON" defined on each "Args" struct +3. EthereumApi method, taking the "Args" type and replying with an interface to be marshalled to ON */ package rpc @@ -38,12 +38,12 @@ type RpcServer interface { Stop() } -func NewEthereumApi(xeth *xeth.JSXEth) *EthereumApi { +func NewEthereumApi(xeth *xeth.XEth) *EthereumApi { return &EthereumApi{xeth: xeth} } type EthereumApi struct { - xeth *xeth.JSXEth + xeth *xeth.XEth } func (p *EthereumApi) GetBlock(args *GetBlockArgs, reply *interface{}) error { @@ -162,7 +162,7 @@ func (p *EthereumApi) GetCodeAt(args *GetCodeAtArgs, reply *interface{}) error { } func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error { - // Spec at https://github.com/ethereum/wiki/wiki/Generic-JSON-RPC + // Spec at https://github.com/ethereum/wiki/wiki/Generic-ON-RPC rpclogger.DebugDetailf("%T %s", req.Params, req.Params) switch req.Method { case "eth_coinbase": diff --git a/rpc/ws/server.go b/rpc/ws/server.go index 248ebc585..37b08ebd9 100644 --- a/rpc/ws/server.go +++ b/rpc/ws/server.go @@ -75,7 +75,7 @@ func (self *WebSocketServer) Start() { wslogger.Infof("Starting RPC-WS server on port %d", self.port) go self.handlerLoop() - api := rpc.NewEthereumApi(xeth.NewJSXEth(self.eth)) + api := rpc.NewEthereumApi(xeth.New(self.eth)) h := self.apiHandler(api) http.Handle("/ws", h) |