diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-17 23:54:52 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-17 23:54:52 +0800 |
commit | 13c00afc68652d517f91313bb8c3eeb206d23f22 (patch) | |
tree | de9e178987c93a02e2635f5ff8f9ed3424f4c644 /rpc/message.go | |
parent | 5238b9439eae0e60b88c65ef33274200f9c734fb (diff) | |
download | go-tangerine-13c00afc68652d517f91313bb8c3eeb206d23f22.tar go-tangerine-13c00afc68652d517f91313bb8c3eeb206d23f22.tar.gz go-tangerine-13c00afc68652d517f91313bb8c3eeb206d23f22.tar.bz2 go-tangerine-13c00afc68652d517f91313bb8c3eeb206d23f22.tar.lz go-tangerine-13c00afc68652d517f91313bb8c3eeb206d23f22.tar.xz go-tangerine-13c00afc68652d517f91313bb8c3eeb206d23f22.tar.zst go-tangerine-13c00afc68652d517f91313bb8c3eeb206d23f22.zip |
Implement register and watchTx
Diffstat (limited to 'rpc/message.go')
-rw-r--r-- | rpc/message.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/rpc/message.go b/rpc/message.go index 7983e003d..b5b852f54 100644 --- a/rpc/message.go +++ b/rpc/message.go @@ -342,3 +342,31 @@ func (req *RpcRequest) ToWhisperHasIdentityArgs() (string, error) { rpclogger.DebugDetailf("%T %v", args, args) return args, nil } + +func (req *RpcRequest) ToRegisterArgs() (string, error) { + if len(req.Params) < 1 { + return "", NewErrorResponse(ErrorArguments) + } + + var args string + err := json.Unmarshal(req.Params[0], &args) + if err != nil { + return "", err + } + rpclogger.DebugDetailf("%T %v", args, args) + return args, nil +} + +func (req *RpcRequest) ToWatchTxArgs() (string, error) { + if len(req.Params) < 1 { + return "", NewErrorResponse(ErrorArguments) + } + + var args string + err := json.Unmarshal(req.Params[0], &args) + if err != nil { + return "", err + } + rpclogger.DebugDetailf("%T %v", args, args) + return args, nil +} |