aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/args.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-26 18:07:14 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-26 18:07:14 +0800
commit493e0d7be883bb1acd3b8588b0e3d641ce06c73b (patch)
treec7f54a7bf73d735674d5a7684104cb615a7522bf /rpc/args.go
parent93af30a6f6308fe4e59b3a96f65ef535f1855865 (diff)
downloadgo-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.go4
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 {