Reimplemented message filters for rpc calls
This commit is contained in:
@ -12,6 +12,17 @@ type AccountChange struct {
|
||||
Address, StateAddress []byte
|
||||
}
|
||||
|
||||
type FilterOptions struct {
|
||||
Earliest int64
|
||||
Latest int64
|
||||
|
||||
Address []byte
|
||||
Topics [][]byte
|
||||
|
||||
Skip int
|
||||
Max int
|
||||
}
|
||||
|
||||
// Filtering interface
|
||||
type Filter struct {
|
||||
eth EthManager
|
||||
@ -32,6 +43,16 @@ func NewFilter(eth EthManager) *Filter {
|
||||
return &Filter{eth: eth}
|
||||
}
|
||||
|
||||
func (self *Filter) SetOptions(options FilterOptions) {
|
||||
self.earliest = options.Earliest
|
||||
self.latest = options.Latest
|
||||
self.skip = options.Skip
|
||||
self.max = options.Max
|
||||
self.address = options.Address
|
||||
self.topics = options.Topics
|
||||
|
||||
}
|
||||
|
||||
// Set the earliest and latest block for filtering.
|
||||
// -1 = latest block (i.e., the current block)
|
||||
// hash = particular hash from-to
|
||||
|
Reference in New Issue
Block a user