diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-26 18:16:01 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-26 19:06:01 +0800 |
commit | 49ded3aa7752148ebfbacd4e6ff5f46dc9376f89 (patch) | |
tree | ebde269fc7a836b67eb8d7a2a95a90297d8c2435 /rpc/messages.go | |
parent | 5ab0eaa06d2f5879b9b22778988410bd0c73dcc0 (diff) | |
parent | 9884eed0cf7c95074fd5b3d5f0f592a423810a8a (diff) | |
download | dexon-49ded3aa7752148ebfbacd4e6ff5f46dc9376f89.tar dexon-49ded3aa7752148ebfbacd4e6ff5f46dc9376f89.tar.gz dexon-49ded3aa7752148ebfbacd4e6ff5f46dc9376f89.tar.bz2 dexon-49ded3aa7752148ebfbacd4e6ff5f46dc9376f89.tar.lz dexon-49ded3aa7752148ebfbacd4e6ff5f46dc9376f89.tar.xz dexon-49ded3aa7752148ebfbacd4e6ff5f46dc9376f89.tar.zst dexon-49ded3aa7752148ebfbacd4e6ff5f46dc9376f89.zip |
Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop
Conflicts:
accounts/account_manager.go
Diffstat (limited to 'rpc/messages.go')
-rw-r--r-- | rpc/messages.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/rpc/messages.go b/rpc/messages.go index 044f07545..b37d8229d 100644 --- a/rpc/messages.go +++ b/rpc/messages.go @@ -210,6 +210,19 @@ func (req *RpcRequest) ToBoolArgs() (bool, error) { return args, nil } +func (req *RpcRequest) ToIntArgs() (int, error) { + if len(req.Params) < 1 { + return 0, errArguments + } + + var args int + if err := json.Unmarshal(req.Params[0], &args); err != nil { + return 0, errArguments + } + + return args, nil +} + func (req *RpcRequest) ToCompileArgs() (string, error) { if len(req.Params) < 1 { return "", errArguments |