diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-27 03:10:31 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-27 03:10:31 +0800 |
commit | 1f1e98f96b57c0c5c7a9350129f67d425a4c6af4 (patch) | |
tree | e2a6a9e8e273fe7240cec9d7c73aa9113a165fa9 /rpc/args.go | |
parent | 62ebf999bf71ef05e34e234b6e07cc31188970b7 (diff) | |
download | go-tangerine-1f1e98f96b57c0c5c7a9350129f67d425a4c6af4.tar.gz go-tangerine-1f1e98f96b57c0c5c7a9350129f67d425a4c6af4.tar.zst go-tangerine-1f1e98f96b57c0c5c7a9350129f67d425a4c6af4.zip |
FilterIdArgs
Diffstat (limited to 'rpc/args.go')
-rw-r--r-- | rpc/args.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/rpc/args.go b/rpc/args.go index 96188d02e..921d8e98c 100644 --- a/rpc/args.go +++ b/rpc/args.go @@ -664,9 +664,8 @@ type FilterIdArgs struct { } func (args *FilterIdArgs) UnmarshalJSON(b []byte) (err error) { - var obj []string - r := bytes.NewReader(b) - if err := json.NewDecoder(r).Decode(&obj); err != nil { + var obj []interface{} + if err := json.Unmarshal(b, &obj); err != nil { return NewDecodeParamError(err.Error()) } @@ -674,7 +673,11 @@ func (args *FilterIdArgs) UnmarshalJSON(b []byte) (err error) { return NewInsufficientParamsError(len(obj), 1) } - args.Id = int(common.Big(obj[0]).Int64()) + var num int64 + if err := numString(obj[0], &num); err != nil { + return err + } + args.Id = int(num) return nil } |