aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/args.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-29 04:41:34 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-29 04:41:34 +0800
commite80ef9ff34562410fbab63ccf173b17508b026ed (patch)
tree76577930112a39af4544c4bc64c8def508a837af /rpc/args.go
parent29930da52272b8fd644c38cc303ba6aa66e49182 (diff)
downloadgo-tangerine-e80ef9ff34562410fbab63ccf173b17508b026ed.tar
go-tangerine-e80ef9ff34562410fbab63ccf173b17508b026ed.tar.gz
go-tangerine-e80ef9ff34562410fbab63ccf173b17508b026ed.tar.bz2
go-tangerine-e80ef9ff34562410fbab63ccf173b17508b026ed.tar.lz
go-tangerine-e80ef9ff34562410fbab63ccf173b17508b026ed.tar.xz
go-tangerine-e80ef9ff34562410fbab63ccf173b17508b026ed.tar.zst
go-tangerine-e80ef9ff34562410fbab63ccf173b17508b026ed.zip
Cleanup
Diffstat (limited to 'rpc/args.go')
-rw-r--r--rpc/args.go21
1 files changed, 7 insertions, 14 deletions
diff --git a/rpc/args.go b/rpc/args.go
index a075f1a59..25a6c7a4f 100644
--- a/rpc/args.go
+++ b/rpc/args.go
@@ -1,9 +1,7 @@
package rpc
import (
- "bytes"
"encoding/json"
- // "errors"
"fmt"
"math/big"
@@ -105,8 +103,8 @@ type GetBlockByHashArgs struct {
func (args *GetBlockByHashArgs) UnmarshalJSON(b []byte) (err error) {
var obj []interface{}
- r := bytes.NewReader(b)
- if err := json.NewDecoder(r).Decode(&obj); err != nil {
+
+ if err := json.Unmarshal(b, &obj); err != nil {
return NewDecodeParamError(err.Error())
}
@@ -134,8 +132,7 @@ type GetBlockByNumberArgs struct {
func (args *GetBlockByNumberArgs) UnmarshalJSON(b []byte) (err error) {
var obj []interface{}
- r := bytes.NewReader(b)
- if err := json.NewDecoder(r).Decode(&obj); err != nil {
+ if err := json.Unmarshal(b, &obj); err != nil {
return NewDecodeParamError(err.Error())
}
@@ -405,8 +402,7 @@ type BlockNumIndexArgs struct {
func (args *BlockNumIndexArgs) UnmarshalJSON(b []byte) (err error) {
var obj []interface{}
- r := bytes.NewReader(b)
- if err := json.NewDecoder(r).Decode(&obj); err != nil {
+ if err := json.Unmarshal(b, &obj); err != nil {
return NewDecodeParamError(err.Error())
}
@@ -436,8 +432,7 @@ type HashIndexArgs struct {
func (args *HashIndexArgs) UnmarshalJSON(b []byte) (err error) {
var obj []interface{}
- r := bytes.NewReader(b)
- if err := json.NewDecoder(r).Decode(&obj); err != nil {
+ if err := json.Unmarshal(b, &obj); err != nil {
return NewDecodeParamError(err.Error())
}
@@ -468,8 +463,7 @@ type Sha3Args struct {
func (args *Sha3Args) UnmarshalJSON(b []byte) (err error) {
var obj []interface{}
- r := bytes.NewReader(b)
- if err := json.NewDecoder(r).Decode(&obj); err != nil {
+ if err := json.Unmarshal(b, &obj); err != nil {
return NewDecodeParamError(err.Error())
}
@@ -798,8 +792,7 @@ type FilterStringArgs struct {
func (args *FilterStringArgs) UnmarshalJSON(b []byte) (err error) {
var obj []interface{}
- r := bytes.NewReader(b)
- if err := json.NewDecoder(r).Decode(&obj); err != nil {
+ if err := json.Unmarshal(b, &obj); err != nil {
return NewDecodeParamError(err.Error())
}