aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/packages.go
diff options
context:
space:
mode:
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
}