aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-04-02 17:57:26 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-04-02 17:57:26 +0800
commit85ebbc9aa5e4c8902b94847dbeb78f26255eb0aa (patch)
tree952b04cfa7ff8fd25ac6c5eac84a16a44076444e /rpc
parentc71ca1a089cc963848c5eee7391a53168adf188c (diff)
downloaddexon-85ebbc9aa5e4c8902b94847dbeb78f26255eb0aa.tar.gz
dexon-85ebbc9aa5e4c8902b94847dbeb78f26255eb0aa.tar.zst
dexon-85ebbc9aa5e4c8902b94847dbeb78f26255eb0aa.zip
Default BlockNumber to -1 when missing
Diffstat (limited to 'rpc')
-rw-r--r--rpc/args.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/rpc/args.go b/rpc/args.go
index dd013147d..220daf960 100644
--- a/rpc/args.go
+++ b/rpc/args.go
@@ -233,6 +233,8 @@ func (args *NewTxArgs) UnmarshalJSON(b []byte) (err error) {
if err := blockHeightFromJson(obj[1], &args.BlockNumber); err != nil {
return err
}
+ } else {
+ args.BlockNumber = -1
}
return nil
@@ -320,6 +322,8 @@ func (args *CallArgs) UnmarshalJSON(b []byte) (err error) {
if err := blockHeightFromJson(obj[1], &args.BlockNumber); err != nil {
return err
}
+ } else {
+ args.BlockNumber = -1
}
return nil
@@ -350,6 +354,8 @@ func (args *GetStorageArgs) UnmarshalJSON(b []byte) (err error) {
if err := blockHeight(obj[1], &args.BlockNumber); err != nil {
return err
}
+ } else {
+ args.BlockNumber = -1
}
return nil
@@ -387,6 +393,8 @@ func (args *GetStorageAtArgs) UnmarshalJSON(b []byte) (err error) {
if err := blockHeight(obj[2], &args.BlockNumber); err != nil {
return err
}
+ } else {
+ args.BlockNumber = -1
}
return nil
@@ -417,6 +425,8 @@ func (args *GetTxCountArgs) UnmarshalJSON(b []byte) (err error) {
if err := blockHeight(obj[1], &args.BlockNumber); err != nil {
return err
}
+ } else {
+ args.BlockNumber = -1
}
return nil
@@ -447,6 +457,8 @@ func (args *GetBalanceArgs) UnmarshalJSON(b []byte) (err error) {
if err := blockHeight(obj[1], &args.BlockNumber); err != nil {
return err
}
+ } else {
+ args.BlockNumber = -1
}
return nil
@@ -477,6 +489,8 @@ func (args *GetDataArgs) UnmarshalJSON(b []byte) (err error) {
if err := blockHeight(obj[1], &args.BlockNumber); err != nil {
return err
}
+ } else {
+ args.BlockNumber = -1
}
return nil