aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/args.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-03-21 05:47:27 +0800
committerFelix Lange <fjl@twurst.com>2015-03-21 05:47:27 +0800
commit81800ca39ea03da7f63d8ecfbd74773f4ca73323 (patch)
tree6d56577858304d970c7754bcd5ac24c2b282f079 /rpc/args.go
parentb95ff54632d9a31286f5b629556071b6043d274a (diff)
parentf4e9638867f5dab01eeb6db5fdbd85737a11fbd6 (diff)
downloaddexon-81800ca39ea03da7f63d8ecfbd74773f4ca73323.tar
dexon-81800ca39ea03da7f63d8ecfbd74773f4ca73323.tar.gz
dexon-81800ca39ea03da7f63d8ecfbd74773f4ca73323.tar.bz2
dexon-81800ca39ea03da7f63d8ecfbd74773f4ca73323.tar.lz
dexon-81800ca39ea03da7f63d8ecfbd74773f4ca73323.tar.xz
dexon-81800ca39ea03da7f63d8ecfbd74773f4ca73323.tar.zst
dexon-81800ca39ea03da7f63d8ecfbd74773f4ca73323.zip
Merge remote-tracking branch 'ethereum/conversion' into conversion
Diffstat (limited to 'rpc/args.go')
-rw-r--r--rpc/args.go26
1 files changed, 18 insertions, 8 deletions
diff --git a/rpc/args.go b/rpc/args.go
index ab1c40585..e50c9b1f5 100644
--- a/rpc/args.go
+++ b/rpc/args.go
@@ -35,8 +35,8 @@ func blockAge(raw interface{}, number *int64) (err error) {
}
type GetBlockByHashArgs struct {
- BlockHash string
- Transactions bool
+ BlockHash string
+ IncludeTxs bool
}
func (args *GetBlockByHashArgs) UnmarshalJSON(b []byte) (err error) {
@@ -57,15 +57,15 @@ func (args *GetBlockByHashArgs) UnmarshalJSON(b []byte) (err error) {
args.BlockHash = argstr
if len(obj) > 1 {
- args.Transactions = obj[1].(bool)
+ args.IncludeTxs = obj[1].(bool)
}
return nil
}
type GetBlockByNumberArgs struct {
- BlockNumber int64
- Transactions bool
+ BlockNumber int64
+ IncludeTxs bool
}
func (args *GetBlockByNumberArgs) UnmarshalJSON(b []byte) (err error) {
@@ -86,7 +86,7 @@ func (args *GetBlockByNumberArgs) UnmarshalJSON(b []byte) (err error) {
}
if len(obj) > 1 {
- args.Transactions = obj[1].(bool)
+ args.IncludeTxs = obj[1].(bool)
}
return nil
@@ -433,7 +433,7 @@ func (args *Sha3Args) UnmarshalJSON(b []byte) (err error) {
return nil
}
-type FilterOptions struct {
+type BlockFilterArgs struct {
Earliest int64
Latest int64
Address interface{}
@@ -442,7 +442,7 @@ type FilterOptions struct {
Max int
}
-func (args *FilterOptions) UnmarshalJSON(b []byte) (err error) {
+func (args *BlockFilterArgs) UnmarshalJSON(b []byte) (err error) {
var obj []struct {
FromBlock interface{} `json:"fromBlock"`
ToBlock interface{} `json:"toBlock"`
@@ -609,6 +609,16 @@ func (args *FilterStringArgs) UnmarshalJSON(b []byte) (err error) {
return nil
}
+func (args *FilterStringArgs) requirements() error {
+ switch args.Word {
+ case "latest", "pending":
+ break
+ default:
+ return NewValidationError("Word", "Must be `latest` or `pending`")
+ }
+ return nil
+}
+
type FilterIdArgs struct {
Id int
}