aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-04-22 23:35:50 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-04-28 15:49:05 +0800
commit978ffd3097242a5faeb7b23b9c72590170004dc6 (patch)
tree3e0853dcff756c503764d0f73c1757c585be2aa9 /rpc
parent2b9fd6b40a759078d1dcc1c7edcfafd4ccf38af3 (diff)
downloadgo-tangerine-978ffd3097242a5faeb7b23b9c72590170004dc6.tar.gz
go-tangerine-978ffd3097242a5faeb7b23b9c72590170004dc6.tar.zst
go-tangerine-978ffd3097242a5faeb7b23b9c72590170004dc6.zip
rpc, xeth: finish cleaning up xeth
Diffstat (limited to 'rpc')
-rw-r--r--rpc/api.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/rpc/api.go b/rpc/api.go
index 4da2fb17a..4a9eb5963 100644
--- a/rpc/api.go
+++ b/rpc/api.go
@@ -406,10 +406,13 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
res, _ := api.xeth().DbGet([]byte(args.Database + args.Key))
*reply = newHexData(res)
+
case "shh_version":
+ // Retrieves the currently running whisper protocol version
*reply = api.xeth().WhisperVersion()
case "shh_post":
+ // Injects a new message into the whisper network
args := new(WhisperMessageArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {
return err
@@ -421,18 +424,17 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
*reply = true
case "shh_newIdentity":
+ // Creates a new whisper identity to use for sending/receiving messages
*reply = api.xeth().Whisper().NewIdentity()
case "shh_hasIdentity":
+ // Checks if an identity if owned or not
args := new(WhisperIdentityArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {
return err
}
*reply = api.xeth().Whisper().HasIdentity(args.Identity)
- case "shh_newGroup", "shh_addToGroup":
- return NewNotImplementedError(req.Method)
-
case "shh_newFilter":
// Create a new filter to watch and match messages with
args := new(WhisperFilterArgs)
@@ -443,6 +445,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
*reply = newHexNum(big.NewInt(int64(id)).Bytes())
case "shh_uninstallFilter":
+ // Remove an existing filter watching messages
args := new(FilterIdArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {
return err
@@ -455,7 +458,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
if err := json.Unmarshal(req.Params, &args); err != nil {
return err
}
- *reply = api.xeth().MessagesChanged(args.Id)
+ *reply = api.xeth().WhisperMessagesChanged(args.Id)
case "shh_getMessages":
// Retrieve all the cached messages matching a specific, existing filter
@@ -463,7 +466,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
if err := json.Unmarshal(req.Params, &args); err != nil {
return err
}
- *reply = api.xeth().Messages(args.Id)
+ *reply = api.xeth().WhisperMessages(args.Id)
// case "eth_register":
// // Placeholder for actual type