transform

package
v0.10.2-fix Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const CallAddrIndexShortName = "calladdrsig"
View Source
const LogAddrIndexShortName = "logaddrsig"

Variables

View Source
var CallToFilterMessageName = proto.MessageName(&pbtransform.CallToFilter{})
View Source
var LightBlockFilterFactory = &transform.Factory{
	Obj: &pbtransform.LightBlock{},
	NewFunc: func(message *anypb.Any) (transform.Transform, error) {
		mname := message.MessageName()
		if mname != LightBlockMessageName {
			return nil, fmt.Errorf("expected type url %q, recevied %q ", LightBlockMessageName, message.TypeUrl)
		}

		filter := &pbtransform.LightBlock{}
		err := proto.Unmarshal(message.Value, filter)
		if err != nil {
			return nil, fmt.Errorf("unexpected unmarshall error: %w", err)
		}
		return &LightBlockFilter{}, nil
	},
}
View Source
var LightBlockMessageName = proto.MessageName(&pbtransform.LightBlock{})
View Source
var LogFilterMessageName = proto.MessageName(&pbtransform.LogFilter{})
View Source
var MultiCallToFilterMessageName = proto.MessageName(&pbtransform.MultiCallToFilter{})
View Source
var MultiLogFilterMessageName = proto.MessageName(&pbtransform.MultiLogFilter{})

Functions

func CallToFilterFactory

func CallToFilterFactory(indexStore dstore.Store, possibleIndexSizes []uint64) *transform.Factory

func LogFilterFactory

func LogFilterFactory(indexStore dstore.Store, possibleIndexSizes []uint64) *transform.Factory

func MultiCallToFilterFactory

func MultiCallToFilterFactory(indexStore dstore.Store, possibleIndexSizes []uint64) *transform.Factory

func MultiLogFilterFactory

func MultiLogFilterFactory(indexStore dstore.Store, possibleIndexSizes []uint64) *transform.Factory

func NewEthCallIndexProvider

func NewEthCallIndexProvider(
	store dstore.Store,
	possibleIndexSizes []uint64,
	filters []*addrSigSingleFilter,
) *transform.GenericBlockIndexProvider

func NewEthLogIndexProvider

func NewEthLogIndexProvider(
	store dstore.Store,
	possibleIndexSizes []uint64,
	filters []*addrSigSingleFilter,
) *transform.GenericBlockIndexProvider

NewEthLogIndexProvider instantiates and returns a new EthLogIndexProvider

Types

type CallIndexer

type CallIndexer interface {
	Add(keys []string, blockNum uint64)
}

type CallToFilter

type CallToFilter struct {
	Addresses  []eth.Address
	Signatures []eth.Hash
	// contains filtered or unexported fields
}

func (*CallToFilter) GetIndexProvider

func (p *CallToFilter) GetIndexProvider() bstream.BlockIndexProvider

GetIndexProvider will instantiate a new CallToAddressIndex conforming to the bstream.BlockIndexProvider interface

func (*CallToFilter) String

func (p *CallToFilter) String() string

func (*CallToFilter) Transform

func (p *CallToFilter) Transform(readOnlyBlk *bstream.Block, in transform.Input) (transform.Output, error)

type EthCallIndexer

type EthCallIndexer struct {
	BlockIndexer LogIndexer
}

EthCallIndexer wraps a bstream.transform.BlockIndexer for chain-specific use on Ethereum

func NewEthCallIndexer

func NewEthCallIndexer(indexStore dstore.Store, indexSize uint64) *EthCallIndexer

NewEthCallIndexer instantiates and returns a new EthCallIndexer

func (*EthCallIndexer) ProcessBlock

func (i *EthCallIndexer) ProcessBlock(blk *pbcodec.Block)

ProcessBlock implements chain-specific logic for Ethereum bstream.Block's

type EthLogIndexer

type EthLogIndexer struct {
	BlockIndexer LogIndexer
}

EthLogIndexer wraps a bstream.transform.BlockIndexer for chain-specific use on Ethereum

func NewEthLogIndexer

func NewEthLogIndexer(indexStore dstore.Store, indexSize uint64) *EthLogIndexer

NewEthLogIndexer instantiates and returns a new EthLogIndexer

func (*EthLogIndexer) ProcessBlock

func (i *EthLogIndexer) ProcessBlock(blk *pbcodec.Block)

ProcessBlock implements chain-specific logic for Ethereum bstream.Block's

type LightBlockFilter

type LightBlockFilter struct{}

func (*LightBlockFilter) String

func (p *LightBlockFilter) String() string

func (*LightBlockFilter) Transform

func (p *LightBlockFilter) Transform(readOnlyBlk *bstream.Block, in transform.Input) (transform.Output, error)

type LogFilter

type LogFilter struct {
	Addresses       []eth.Address
	EventSignatures []eth.Hash
	// contains filtered or unexported fields
}

func (*LogFilter) GetIndexProvider

func (p *LogFilter) GetIndexProvider() bstream.BlockIndexProvider

GetIndexProvider will instantiate a new LogAddressIndex conforming to the bstream.BlockIndexProvider interface

func (*LogFilter) String

func (p *LogFilter) String() string

func (*LogFilter) Transform

func (p *LogFilter) Transform(readOnlyBlk *bstream.Block, in transform.Input) (transform.Output, error)

type LogIndexer

type LogIndexer interface {
	Add(keys []string, blockNum uint64)
}

type MultiCallToFilter

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

func (*MultiCallToFilter) GetIndexProvider

func (p *MultiCallToFilter) GetIndexProvider() bstream.BlockIndexProvider

GetIndexProvider will instantiate a new CallAddressIndex conforming to the bstream.BlockIndexProvider interface

func (*MultiCallToFilter) String

func (p *MultiCallToFilter) String() string

func (*MultiCallToFilter) Transform

func (p *MultiCallToFilter) Transform(readOnlyBlk *bstream.Block, in transform.Input) (transform.Output, error)

type MultiLogFilter

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

func (*MultiLogFilter) GetIndexProvider

func (p *MultiLogFilter) GetIndexProvider() bstream.BlockIndexProvider

GetIndexProvider will instantiate a new LogAddressIndex conforming to the bstream.BlockIndexProvider interface

func (*MultiLogFilter) String

func (p *MultiLogFilter) String() string

func (*MultiLogFilter) Transform

func (p *MultiLogFilter) Transform(readOnlyBlk *bstream.Block, in transform.Input) (transform.Output, error)

Jump to

Keyboard shortcuts

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