aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/packages.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-28 21:52:09 +0800
committerobscuren <geffobscura@gmail.com>2015-01-28 21:52:09 +0800
commitb46e1ca97e61ebfe4c37961e723142245efe5016 (patch)
tree45838760ad08592995cd1051c29c6d41d08cd24c /rpc/packages.go
parent159c4d56cd82d6fe721058557977f4efda31661c (diff)
parente9d017ba082bfd624267c974fa93a77da6269756 (diff)
downloaddexon-b46e1ca97e61ebfe4c37961e723142245efe5016.tar.gz
dexon-b46e1ca97e61ebfe4c37961e723142245efe5016.tar.zst
dexon-b46e1ca97e61ebfe4c37961e723142245efe5016.zip
Merge branch 'jsonrpc' of github.com-obscure:ethereum/go-ethereum into jsonrpc
Diffstat (limited to 'rpc/packages.go')
-rw-r--r--rpc/packages.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/rpc/packages.go b/rpc/packages.go
index e87e0db7c..8b5965069 100644
--- a/rpc/packages.go
+++ b/rpc/packages.go
@@ -33,6 +33,15 @@ import (
"github.com/ethereum/go-ethereum/xeth"
)
+type RpcServer interface {
+ Start()
+ Stop()
+}
+
+func NewEthereumApi(xeth *xeth.JSXEth) *EthereumApi {
+ return &EthereumApi{pipe: xeth}
+}
+
type EthereumApi struct {
pipe *xeth.JSXEth
}
@@ -103,7 +112,7 @@ func (p *EthereumApi) GetStorageAt(args *GetStorageArgs, reply *interface{}) err
i, _ := new(big.Int).SetString(args.Key, 10)
hx = ethutil.Bytes2Hex(i.Bytes())
}
- jsonlogger.Debugf("GetStorageAt(%s, %s)\n", args.Address, hx)
+ rpclogger.Debugf("GetStorageAt(%s, %s)\n", args.Address, hx)
value := state.Storage(ethutil.Hex2Bytes(hx))
*reply = GetStorageAtRes{Address: args.Address, Key: args.Key, Value: value.Str()}
return nil
@@ -159,7 +168,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
- jsonlogger.DebugDetailf("%T %s", req.Params, req.Params)
+ rpclogger.DebugDetailf("%T %s", req.Params, req.Params)
switch req.Method {
case "eth_coinbase":
return p.GetCoinbase(reply)
@@ -203,6 +212,6 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
return NewErrorResponse(ErrorNotImplemented)
}
- jsonlogger.DebugDetailf("Reply: %T %s", reply, reply)
+ rpclogger.DebugDetailf("Reply: %T %s", reply, reply)
return nil
}