logfilter

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BlockHeightPrefix is an prefix which will concatenate with blocknumber when adding into rangeBloomFilter
	BlockHeightPrefix = "height"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LogFilter

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

LogFilter contains options for contract log filtering.

func NewLogFilter

func NewLogFilter(in *iotexapi.LogsFilter, stream iotexapi.APIService_StreamLogsServer, errChan chan error) *LogFilter

NewLogFilter returns a new log filter

func (*LogFilter) ExistInBloomFilter

func (l *LogFilter) ExistInBloomFilter(bf bloom.BloomFilter) bool

ExistInBloomFilter returns true if topics of filter exist in the bloom filter

func (*LogFilter) ExistInBloomFilterv2

func (l *LogFilter) ExistInBloomFilterv2(bf bloom.BloomFilter) bool

ExistInBloomFilterv2 returns true if addresses and topics of filter exist in the range bloom filter (topic: position-sensitive)

func (*LogFilter) Exit

func (l *LogFilter) Exit()

Exit send to error channel

func (*LogFilter) MatchLogs

func (l *LogFilter) MatchLogs(receipts []*action.Receipt, blkHash hash.Hash256) []*iotextypes.Log

MatchLogs returns matching logs in a given block

func (*LogFilter) Respond

func (l *LogFilter) Respond(blk *block.Block) error

Respond to new block

func (*LogFilter) SelectBlocksFromRangeBloomFilter

func (l *LogFilter) SelectBlocksFromRangeBloomFilter(bf bloom.BloomFilter, start, end uint64) []uint64

SelectBlocksFromRangeBloomFilter filters out RangeBloomFilter for selecting block numbers which have logFilter's topics/address TODO[dorothy]: optimize using goroutine

Jump to

Keyboard shortcuts

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