aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/args.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-20 22:25:43 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-20 22:25:43 +0800
commit28e1971272d5bab6aa683d3bbe711226ca1fef98 (patch)
tree53dc1673f27dac058a37c738b8fe32b2ddd9a5c9 /rpc/args.go
parent41c493ace9182bc99226d66dc4479277fbbf749d (diff)
parent0cde7a4d46f68863535fbe470499b9d0dfd6ed7a (diff)
downloaddexon-28e1971272d5bab6aa683d3bbe711226ca1fef98.tar
dexon-28e1971272d5bab6aa683d3bbe711226ca1fef98.tar.gz
dexon-28e1971272d5bab6aa683d3bbe711226ca1fef98.tar.bz2
dexon-28e1971272d5bab6aa683d3bbe711226ca1fef98.tar.lz
dexon-28e1971272d5bab6aa683d3bbe711226ca1fef98.tar.xz
dexon-28e1971272d5bab6aa683d3bbe711226ca1fef98.tar.zst
dexon-28e1971272d5bab6aa683d3bbe711226ca1fef98.zip
Merge branch 'rpcxeth' into rpcfrontier
Conflicts: rpc/api.go
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
}