Documentation ¶
Index ¶
Constants ¶
View Source
const ( // WildcardForkId It match for all forkIds WildcardForkId ForkIdType = 0 // ForkIDIncaberry is the forkId for incaberry ForkIDIncaberry = ForkIdType(6) // nolint:gomnd // ForkIDEtrog is the forkId for etrog ForkIDEtrog = ForkIdType(7) //nolint:gomnd // ForkIDElderberry is the forkId for Elderberry ForkIDElderberry = ForkIdType(8) //nolint:gomnd )
Variables ¶
View Source
var ( // ForksIdAll support all forkIds ForksIdAll = []ForkIdType{WildcardForkId} // ForksIdOnlyElderberry support only elderberry forkId ForksIdOnlyElderberry = []ForkIdType{ForkIDElderberry} // ForksIdOnlyEtrog support only etrog forkId ForksIdOnlyEtrog = []ForkIdType{ForkIDEtrog} // ForksIdToIncaberry support all forkIds till incaberry ForksIdToIncaberry = []ForkIdType{1, 2, 3, 4, 5, ForkIDIncaberry} )
View Source
var ( // ErrInvalidParams is used when the object is not found ErrInvalidParams = errors.New("invalid params") )
Functions ¶
This section is empty.
Types ¶
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.