topicsdb

package
v0.0.0-...-34d0e24 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MaxTopicsCount = 5 // count is limited hard to 5 by EVM (see LOG0...LOG4 ops)

Variables

View Source
var (
	ErrEmptyTopics  = fmt.Errorf("Empty topics")
	ErrTooBigTopics = fmt.Errorf("Too big topics")
)

Functions

This section is empty.

Types

type ID

type ID [logrecKeySize]byte

ID of log record

func NewID

func NewID(block uint64, tx common.Hash, logIndex uint) (id ID)

func (*ID) BlockNumber

func (id *ID) BlockNumber() uint64

func (*ID) Bytes

func (id *ID) Bytes() []byte

func (*ID) Index

func (id *ID) Index() uint

func (*ID) TxHash

func (id *ID) TxHash() (tx common.Hash)

type Index

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

Index is a specialized indexes for log records storing and fetching.

func New

func New(db kvdb.Store) *Index

New Index instance.

func (*Index) FindInBlocks

func (tt *Index) FindInBlocks(ctx context.Context, from, to idx.Block, pattern [][]common.Hash) (logs []*types.Log, err error)

FindInBlocks returns all log records of block range by pattern. 1st pattern element is an address. The same as FindInBlocksAsync but fetches log's body sync.

func (*Index) ForEach

func (tt *Index) ForEach(ctx context.Context, pattern [][]common.Hash, onLog func(*types.Log) (gonext bool)) error

ForEach matches log records by pattern. 1st pattern element is an address.

func (*Index) ForEachInBlocks

func (tt *Index) ForEachInBlocks(ctx context.Context, from, to idx.Block, pattern [][]common.Hash, onLog func(*types.Log) (gonext bool)) error

ForEachInBlocks matches log records of block range by pattern. 1st pattern element is an address.

func (*Index) MustPush

func (tt *Index) MustPush(recs ...*types.Log)

MustPush calls Write() and panics if error.

func (*Index) Push

func (tt *Index) Push(recs ...*types.Log) error

Write log record to database.

Jump to

Keyboard shortcuts

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