Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ForksIdToIncaberry support all forkIds till incaberry ForksIdToIncaberry = []ForkIdType{1, 2, 3, 4, 5, 6} // ForksIdAll support all forkIds ForksIdAll = []ForkIdType{WildcardForkId} )
View Source
var ( // ErrInvalidParams is used when the object is not found ErrInvalidParams = errors.New("invalid params") )
Functions ¶
This section is empty.
Types ¶
type ForkIdType ¶
type ForkIdType uint64
ForkIdType is the type of the forkId
const ( // WildcardForkId It match for all forkIds WildcardForkId ForkIdType = 0 )
type L1EventProcessor ¶
type L1EventProcessor interface { // Name of the processor Name() string // SupportedForkIds list of forkId that support (you could use WildcardForkId) SupportedForkIds() []ForkIdType // SupportedEvents list of events that support (typically one) SupportedEvents() []etherman.EventOrder // Process a incomming event Process(ctx context.Context, order etherman.Order, l1Block *etherman.Block, dbTx pgx.Tx) error }
L1EventProcessor is the interface for a processor of L1 events The main function is Process that must execute the event
type ProcessorBase ¶
type ProcessorBase[T any] struct { SupportedEvent []etherman.EventOrder SupportedForkdIds *[]ForkIdType }
ProcessorBase is the base struct for all the processors, if reduces the boilerplate implementing the Name, SupportedEvents and SupportedForkIds functions
func (*ProcessorBase[T]) Name ¶
func (g *ProcessorBase[T]) Name() string
Name returns the name of the struct T
func (*ProcessorBase[T]) SupportedEvents ¶
func (p *ProcessorBase[T]) SupportedEvents() []etherman.EventOrder
SupportedEvents returns the supported events in the struct
func (*ProcessorBase[T]) SupportedForkIds ¶
func (p *ProcessorBase[T]) SupportedForkIds() []ForkIdType
SupportedForkIds returns the supported forkIds in the struct or the dafault till incaberry forkId
Click to show internal directories.
Click to hide internal directories.