Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCantProcessThisEvent is used when the object is not found ErrCantProcessThisEvent = errors.New("not a processor for this event/forkid") )
Functions ¶
This section is empty.
Types ¶
type L1EventProcessors ¶
type L1EventProcessors struct {
// contains filtered or unexported fields
}
L1EventProcessors is a manager of L1EventProcessor, it have processor for each forkId and event
and it could: - Returns specific processor for a forkId and event (Get function) - Execute a event for a forkId and event (Process function)
To build the object use L1EventProcessorsBuilder
func NewL1EventProcessors ¶
func NewL1EventProcessors() *L1EventProcessors
NewL1EventProcessors returns a empty new L1EventProcessors
func (*L1EventProcessors) Get ¶
func (p *L1EventProcessors) Get(forkId actions.ForkIdType, event etherman.EventOrder) actions.L1EventProcessor
Get returns the processor, first try specific, if not wildcard and if not found returns nil
type L1EventProcessorsBuilder ¶
type L1EventProcessorsBuilder struct {
// contains filtered or unexported fields
}
L1EventProcessorsBuilder is a builder for L1EventProcessors how to use:
p := L1EventProcessorsBuilder{} p.Add(etherman.GlobalExitRootsOrder, l1events.NewGlobalExitRootLegacy(state)) p.Set.... return p.Build()
func NewL1EventProcessorsBuilder ¶
func NewL1EventProcessorsBuilder() L1EventProcessorsBuilder
NewL1EventProcessorsBuilder returns a new L1EventProcessorsBuilder instance
func (*L1EventProcessorsBuilder) Build ¶
func (p *L1EventProcessorsBuilder) Build() *L1EventProcessors
Build return the L1EventProcessors builded
func (*L1EventProcessorsBuilder) Register ¶
func (p *L1EventProcessorsBuilder) Register(processor actions.L1EventProcessor)
Register register a L1EventProcessor. It ask to the processor the supported forkId and events if there are a previous object register it will panic
func (*L1EventProcessorsBuilder) Set ¶
func (p *L1EventProcessorsBuilder) Set(forkID actions.ForkIdType, event etherman.EventOrder, processor actions.L1EventProcessor, panicIfExists bool)
Set add a L1EventProcessor. If param panicIfExists is true, will panic if already exists the object
the only use to panicIfExists=false is to override a processor in a unitttest