aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-03-25 20:55:46 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-03-25 20:55:46 +0800
commitaa1eae67ecd8a85a043f49e36e33bd3c44a1d94c (patch)
tree836fbfcb33ee385a19f0e5e529262efb0a905995 /rpc
parent7f0c2545a91fd2dce0fea8078222a80dccd8b42b (diff)
parent2b93843d86532db3d6b530daf15c04fde0b73eba (diff)
downloadgo-tangerine-aa1eae67ecd8a85a043f49e36e33bd3c44a1d94c.tar
go-tangerine-aa1eae67ecd8a85a043f49e36e33bd3c44a1d94c.tar.gz
go-tangerine-aa1eae67ecd8a85a043f49e36e33bd3c44a1d94c.tar.bz2
go-tangerine-aa1eae67ecd8a85a043f49e36e33bd3c44a1d94c.tar.lz
go-tangerine-aa1eae67ecd8a85a043f49e36e33bd3c44a1d94c.tar.xz
go-tangerine-aa1eae67ecd8a85a043f49e36e33bd3c44a1d94c.tar.zst
go-tangerine-aa1eae67ecd8a85a043f49e36e33bd3c44a1d94c.zip
Merge pull request #560 from tgerring/xethcleanup
XEth cleanup
Diffstat (limited to 'rpc')
-rw-r--r--rpc/api.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/rpc/api.go b/rpc/api.go
index 4bc199176..aa5b54199 100644
--- a/rpc/api.go
+++ b/rpc/api.go
@@ -49,7 +49,7 @@ func (api *EthereumApi) Close() {
}
func (api *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/JSON-RPC
rpclogger.Debugf("%s %s", req.Method, req.Params)
switch req.Method {
@@ -60,14 +60,16 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
}
*reply = common.ToHex(crypto.Sha3(common.FromHex(args.Data)))
case "web3_clientVersion":
- *reply = api.xeth().Backend().Version()
+ *reply = api.xeth().ClientVersion()
case "net_version":
- *reply = string(api.xeth().Backend().ProtocolVersion())
+ *reply = api.xeth().NetworkVersion()
case "net_listening":
*reply = api.xeth().IsListening()
case "net_peerCount":
v := api.xeth().PeerCount()
*reply = common.ToHex(big.NewInt(int64(v)).Bytes())
+ case "eth_version":
+ *reply = api.xeth().EthVersion()
case "eth_coinbase":
// TODO handling of empty coinbase due to lack of accounts
res := api.xeth().Coinbase()
@@ -84,7 +86,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
case "eth_accounts":
*reply = api.xeth().Accounts()
case "eth_blockNumber":
- v := api.xeth().Backend().ChainManager().CurrentBlock().Number()
+ v := api.xeth().CurrentBlock().Number()
*reply = common.ToHex(v.Bytes())
case "eth_getBalance":
args := new(GetBalanceArgs)
@@ -406,6 +408,8 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
res, _ := api.db.Get([]byte(args.Database + args.Key))
*reply = common.ToHex(res)
+ case "shh_version":
+ *reply = api.xeth().WhisperVersion()
case "shh_post":
args := new(WhisperMessageArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {