aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/args.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-27 04:07:50 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-27 04:07:50 +0800
commit1f3814141b94166cc5bf5b439babe6cc56b3cebf (patch)
tree1552094d748d5cea9d5c0a5902be167014a2a653 /rpc/args.go
parent9ca87afd0ba043043a3d2b4919d72b7f7a39ffe8 (diff)
downloadgo-tangerine-1f3814141b94166cc5bf5b439babe6cc56b3cebf.tar
go-tangerine-1f3814141b94166cc5bf5b439babe6cc56b3cebf.tar.gz
go-tangerine-1f3814141b94166cc5bf5b439babe6cc56b3cebf.tar.bz2
go-tangerine-1f3814141b94166cc5bf5b439babe6cc56b3cebf.tar.lz
go-tangerine-1f3814141b94166cc5bf5b439babe6cc56b3cebf.tar.xz
go-tangerine-1f3814141b94166cc5bf5b439babe6cc56b3cebf.tar.zst
go-tangerine-1f3814141b94166cc5bf5b439babe6cc56b3cebf.zip
WhisperMessageArgs
Diffstat (limited to 'rpc/args.go')
-rw-r--r--rpc/args.go17
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
}