aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/args.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-13 22:03:19 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-13 22:03:19 +0800
commit0932f843830a30ea3da5d866fbe4e459d2748b1e (patch)
tree6a65f6e67493f8511e59a27222962eb86a6aabb0 /rpc/args.go
parentd4ed66c83df40c6d3035e21c705b4ca06e52a0be (diff)
downloadgo-tangerine-0932f843830a30ea3da5d866fbe4e459d2748b1e.tar.gz
go-tangerine-0932f843830a30ea3da5d866fbe4e459d2748b1e.tar.zst
go-tangerine-0932f843830a30ea3da5d866fbe4e459d2748b1e.zip
Fix eth_newBlockFilter
Diffstat (limited to 'rpc/args.go')
-rw-r--r--rpc/args.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/rpc/args.go b/rpc/args.go
index 8d4ad5967..b935c5007 100644
--- a/rpc/args.go
+++ b/rpc/args.go
@@ -503,7 +503,7 @@ type FilterStringArgs struct {
}
func (args *FilterStringArgs) UnmarshalJSON(b []byte) (err error) {
- var obj []string
+ var obj []interface{}
r := bytes.NewReader(b)
if err := json.NewDecoder(r).Decode(&obj); err != nil {
return NewDecodeParamError(err.Error())
@@ -513,7 +513,12 @@ func (args *FilterStringArgs) UnmarshalJSON(b []byte) (err error) {
return NewInsufficientParamsError(len(obj), 1)
}
- args.Word = obj[0]
+ var argstr string
+ argstr, ok := obj[0].(string)
+ if !ok {
+ return NewDecodeParamError("Filter is not a string")
+ }
+ args.Word = argstr
return nil
}