diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-04-23 02:24:10 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-04-23 02:24:10 +0800 |
commit | 2ea2261156eae9e7d783ff5f8663ad95113c8386 (patch) | |
tree | 24bf7d7c1f54a27b8db8170d1f0d315bbf0e7c85 /rpc/args.go | |
parent | 35ad9febceacbb0a40efe84b08205bb13222c1b5 (diff) | |
download | go-tangerine-2ea2261156eae9e7d783ff5f8663ad95113c8386.tar.gz go-tangerine-2ea2261156eae9e7d783ff5f8663ad95113c8386.tar.zst go-tangerine-2ea2261156eae9e7d783ff5f8663ad95113c8386.zip |
Accept num or hex as index
Diffstat (limited to 'rpc/args.go')
-rw-r--r-- | rpc/args.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rpc/args.go b/rpc/args.go index 9f99456e6..7694a3d3f 100644 --- a/rpc/args.go +++ b/rpc/args.go @@ -535,11 +535,11 @@ func (args *BlockNumIndexArgs) UnmarshalJSON(b []byte) (err error) { return err } - arg1, ok := obj[1].(string) - if !ok { - return NewInvalidTypeError("index", "not a string") + var arg1 *big.Int + if arg1, err = numString(obj[1]); err != nil { + return err } - args.Index = common.Big(arg1).Int64() + args.Index = arg1.Int64() return nil } |