diff options
Diffstat (limited to 'rpc/args.go')
-rw-r--r-- | rpc/args.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/rpc/args.go b/rpc/args.go index d31773ff7..9f99456e6 100644 --- a/rpc/args.go +++ b/rpc/args.go @@ -145,12 +145,8 @@ func (args *GetBlockByNumberArgs) UnmarshalJSON(b []byte) (err error) { return NewInsufficientParamsError(len(obj), 2) } - 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 { - return NewInvalidTypeError("blockNumber", "not a number or string") + if err := blockHeight(obj[0], &args.BlockNumber); err != nil { + return err } args.IncludeTxs = obj[1].(bool) |