aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/message.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-02-20 01:58:15 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-02-20 01:58:15 +0800
commita59cd94625f589bb167be7a9c4588ff959dcfc00 (patch)
treefb7a4c697b6814da60f8cae29d0d497951e741f6 /rpc/message.go
parent605dd3a9820bb74be883afe3cb0e462aca40b32d (diff)
downloadgo-tangerine-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar
go-tangerine-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar.gz
go-tangerine-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar.bz2
go-tangerine-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar.lz
go-tangerine-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar.xz
go-tangerine-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar.zst
go-tangerine-a59cd94625f589bb167be7a9c4588ff959dcfc00.zip
Add setMining RPC method
Diffstat (limited to 'rpc/message.go')
-rw-r--r--rpc/message.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/rpc/message.go b/rpc/message.go
index 1935bf1e2..d02acef0e 100644
--- a/rpc/message.go
+++ b/rpc/message.go
@@ -201,6 +201,21 @@ func (req *RpcRequest) ToGetCodeAtArgs() (*GetCodeAtArgs, error) {
return args, nil
}
+func (req *RpcRequest) ToBoolArgs() (bool, error) {
+ if len(req.Params) < 1 {
+ return false, NewErrorResponse(ErrorArguments)
+ }
+
+ var args bool
+ err := json.Unmarshal(req.Params[0], &args)
+ if err != nil {
+ return false, NewErrorResponse(ErrorDecodeArgs)
+ }
+
+ rpclogger.DebugDetailf("%T %v", args, args)
+ return args, nil
+}
+
func (req *RpcRequest) ToCompileArgs() (string, error) {
if len(req.Params) < 1 {
return "", NewErrorResponse(ErrorArguments)