diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-26 18:07:14 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-26 18:07:14 +0800 |
commit | 493e0d7be883bb1acd3b8588b0e3d641ce06c73b (patch) | |
tree | c7f54a7bf73d735674d5a7684104cb615a7522bf /rpc/args.go | |
parent | 93af30a6f6308fe4e59b3a96f65ef535f1855865 (diff) | |
download | go-tangerine-493e0d7be883bb1acd3b8588b0e3d641ce06c73b.tar go-tangerine-493e0d7be883bb1acd3b8588b0e3d641ce06c73b.tar.gz go-tangerine-493e0d7be883bb1acd3b8588b0e3d641ce06c73b.tar.bz2 go-tangerine-493e0d7be883bb1acd3b8588b0e3d641ce06c73b.tar.lz go-tangerine-493e0d7be883bb1acd3b8588b0e3d641ce06c73b.tar.xz go-tangerine-493e0d7be883bb1acd3b8588b0e3d641ce06c73b.tar.zst go-tangerine-493e0d7be883bb1acd3b8588b0e3d641ce06c73b.zip |
improved GetBlockByNumber tests
Diffstat (limited to 'rpc/args.go')
-rw-r--r-- | rpc/args.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rpc/args.go b/rpc/args.go index 8d7427f6f..7504293a4 100644 --- a/rpc/args.go +++ b/rpc/args.go @@ -81,8 +81,10 @@ func (args *GetBlockByNumberArgs) UnmarshalJSON(b []byte) (err error) { if v, ok := obj[0].(float64); ok { args.BlockNumber = int64(v) + } else if v, ok := obj[0].(string); ok { + args.BlockNumber = common.Big(v).Int64() } else { - args.BlockNumber = common.Big(obj[0].(string)).Int64() + return NewDecodeParamError("blockNumber must be number or string") } if len(obj) > 1 { |