diff options
author | obscuren <geffobscura@gmail.com> | 2015-01-29 23:52:00 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-01-29 23:52:00 +0800 |
commit | 6488a392a347d0d47212fdc78386e3e0e5841d7d (patch) | |
tree | ed95cdf67028b2b60ddc7850728abe9a391796bf /rpc/args.go | |
parent | ddf17d93acf92ef18b0134f19f22220362e06bad (diff) | |
download | dexon-6488a392a347d0d47212fdc78386e3e0e5841d7d.tar.gz dexon-6488a392a347d0d47212fdc78386e3e0e5841d7d.tar.zst dexon-6488a392a347d0d47212fdc78386e3e0e5841d7d.zip |
Reimplemented message filters for rpc calls
Diffstat (limited to 'rpc/args.go')
-rw-r--r-- | rpc/args.go | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/rpc/args.go b/rpc/args.go index ff4974792..79519e7d2 100644 --- a/rpc/args.go +++ b/rpc/args.go @@ -1,6 +1,7 @@ package rpc import "encoding/json" +import "github.com/ethereum/go-ethereum/core" type GetBlockArgs struct { BlockNumber int32 @@ -36,10 +37,6 @@ type NewTxArgs struct { Data string `json:"data"` } -// type TxResponse struct { -// Hash string -// } - func (a *NewTxArgs) requirements() error { if a.Gas == "" { return NewErrorResponse("Transact requires a 'gas' value as argument") @@ -195,3 +192,29 @@ func (obj *Sha3Args) UnmarshalJSON(b []byte) (err error) { } return } + +type FilterOptions struct { + Earliest int64 + Latest int64 + Address string + Topics []string + Skip int + Max int +} + +func toFilterOptions(options *FilterOptions) core.FilterOptions { + var opts core.FilterOptions + opts.Earliest = options.Earliest + opts.Latest = options.Latest + opts.Address = fromHex(options.Address) + opts.Topics = make([][]byte, len(options.Topics)) + for i, topic := range options.Topics { + opts.Topics[i] = fromHex(topic) + } + + return opts +} + +type FilterChangedArgs struct { + n int +} |