actions

package
v0.5.4-RC1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 5 Imported by: 0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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