diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-02-20 01:41:50 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-02-20 01:41:50 +0800 |
commit | 605dd3a9820bb74be883afe3cb0e462aca40b32d (patch) | |
tree | 7a77f0f41ad1582b32080f5623fa4d7b5dce3020 /rpc/message.go | |
parent | dba4f3122e83a66edc1fa089c5d69f789b07a6b3 (diff) | |
download | dexon-605dd3a9820bb74be883afe3cb0e462aca40b32d.tar dexon-605dd3a9820bb74be883afe3cb0e462aca40b32d.tar.gz dexon-605dd3a9820bb74be883afe3cb0e462aca40b32d.tar.bz2 dexon-605dd3a9820bb74be883afe3cb0e462aca40b32d.tar.lz dexon-605dd3a9820bb74be883afe3cb0e462aca40b32d.tar.xz dexon-605dd3a9820bb74be883afe3cb0e462aca40b32d.tar.zst dexon-605dd3a9820bb74be883afe3cb0e462aca40b32d.zip |
Add serpent compilation to RPC
Diffstat (limited to 'rpc/message.go')
-rw-r--r-- | rpc/message.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/rpc/message.go b/rpc/message.go index 524d7fc84..1935bf1e2 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) ToCompileArgs() (string, error) { + if len(req.Params) < 1 { + return "", NewErrorResponse(ErrorArguments) + } + + var args string + err := json.Unmarshal(req.Params[0], &args) + if err != nil { + return "", NewErrorResponse(ErrorDecodeArgs) + } + + rpclogger.DebugDetailf("%T %v", args, args) + return args, nil +} + func (req *RpcRequest) ToFilterArgs() (*FilterOptions, error) { if len(req.Params) < 1 { return nil, NewErrorResponse(ErrorArguments) |