aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/args.go
diff options
context:
space:
mode:
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 {