diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-27 04:07:50 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-27 04:07:50 +0800 |
commit | 1f3814141b94166cc5bf5b439babe6cc56b3cebf (patch) | |
tree | 1552094d748d5cea9d5c0a5902be167014a2a653 /rpc/args.go | |
parent | 9ca87afd0ba043043a3d2b4919d72b7f7a39ffe8 (diff) | |
download | dexon-1f3814141b94166cc5bf5b439babe6cc56b3cebf.tar.gz dexon-1f3814141b94166cc5bf5b439babe6cc56b3cebf.tar.zst dexon-1f3814141b94166cc5bf5b439babe6cc56b3cebf.zip |
WhisperMessageArgs
Diffstat (limited to 'rpc/args.go')
-rw-r--r-- | rpc/args.go | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/rpc/args.go b/rpc/args.go index 5ad971ced..3637aff66 100644 --- a/rpc/args.go +++ b/rpc/args.go @@ -590,8 +590,8 @@ func (args *WhisperMessageArgs) UnmarshalJSON(b []byte) (err error) { To string From string Topics []string - Priority string - Ttl string + Priority interface{} + Ttl interface{} } if err = json.Unmarshal(b, &obj); err != nil { @@ -605,8 +605,17 @@ func (args *WhisperMessageArgs) UnmarshalJSON(b []byte) (err error) { args.To = obj[0].To args.From = obj[0].From args.Topics = obj[0].Topics - args.Priority = uint32(common.Big(obj[0].Priority).Int64()) - args.Ttl = uint32(common.Big(obj[0].Ttl).Int64()) + + var num int64 + if err := numString(obj[0].Priority, &num); err != nil { + return err + } + args.Priority = uint32(num) + + if err := numString(obj[0].Ttl, &num); err != nil { + return err + } + args.Ttl = uint32(num) return nil } |