aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/args.go
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/args.go')
-rw-r--r--rpc/args.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/rpc/args.go b/rpc/args.go
index 921d8e98c..c11ffa3cc 100644
--- a/rpc/args.go
+++ b/rpc/args.go
@@ -687,9 +687,8 @@ type WhisperIdentityArgs struct {
}
func (args *WhisperIdentityArgs) 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())
}
@@ -697,7 +696,14 @@ func (args *WhisperIdentityArgs) UnmarshalJSON(b []byte) (err error) {
return NewInsufficientParamsError(len(obj), 1)
}
- args.Identity = obj[0]
+ argstr, ok := obj[0].(string)
+ if !ok {
+ return NewInvalidTypeError("arg0", "not a string")
+ }
+ // if !common.IsHex(argstr) {
+ // return NewValidationError("arg0", "not a hexstring")
+ // }
+ args.Identity = argstr
return nil
}