aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/args.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-21 21:52:31 +0800
committerobscuren <geffobscura@gmail.com>2015-03-21 21:52:31 +0800
commit38c7c589e4a1b08baaab5b81de6aca7fa853d284 (patch)
treeb6b1a3e0f6c81b62b10b3b15b5e751ae0bd93c60 /rpc/args.go
parent9edb9a21bce97594928f8660e8e32df2cb25b74d (diff)
parent28e1971272d5bab6aa683d3bbe711226ca1fef98 (diff)
downloadgo-tangerine-38c7c589e4a1b08baaab5b81de6aca7fa853d284.tar
go-tangerine-38c7c589e4a1b08baaab5b81de6aca7fa853d284.tar.gz
go-tangerine-38c7c589e4a1b08baaab5b81de6aca7fa853d284.tar.bz2
go-tangerine-38c7c589e4a1b08baaab5b81de6aca7fa853d284.tar.lz
go-tangerine-38c7c589e4a1b08baaab5b81de6aca7fa853d284.tar.xz
go-tangerine-38c7c589e4a1b08baaab5b81de6aca7fa853d284.tar.zst
go-tangerine-38c7c589e4a1b08baaab5b81de6aca7fa853d284.zip
Merge branch 'rpcfrontier' into develop
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
}