filters

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2019 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	EventBus() *types.EventBus
	HeaderByHeight(ctx context.Context, blockNr rpc.BlockNumber) (*types.Header, error)

	GetReceipts(ctx context.Context, blockNr uint64) types.Receipts

	BloomStatus() (uint64, uint64)
	ServiceFilter(ctx context.Context, session *bloombits.MatcherSession)
}

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

Filter can be used to retrieve and filter logs.

func New

func New(backend Backend, begin, end int64, addresses []common.Address, topics [][]common.Hash) *Filter

New creates a new filter which uses a bloom filter on blocks to figure out whether a particular block is interesting or not.

func (*Filter) Logs

func (f *Filter) Logs(ctx context.Context) ([]*types.Log, error)

Logs searches the blockchain for matching log entries, returning all from the first block that contains matches, updating the start of the filter accordingly.

type FilterCriteria

type FilterCriteria struct {
	FromBlock *hexutil.Big     `json:"fromBlock"`
	ToBlock   *hexutil.Big     `json:"toBlock"`
	Addresses []common.Address `json:"addrs" gencodec:"required"`
	Topics    [][]common.Hash  `json:"topics" gencodec:"required"`
}

FilterCriteria represents a request to create a new filter.

func (FilterCriteria) String

func (fc FilterCriteria) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL