listener

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeaconProvider

type BeaconProvider interface {
	Finality(ctx context.Context, opts *api.FinalityOpts) (*api.Response[*apiv1.Finality], error)
}

type BlockStorer

type BlockStorer interface {
	StoreBlock(epoch *big.Int, domainID uint8) error
}

type EVMListener

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

func NewEVMListener

func NewEVMListener(
	beaconProvider BeaconProvider,
	eventHandlers []EventHandler,
	domainID uint8,
	retryInterval time.Duration,
) *EVMListener

NewEVMListener creates an EVMListener that listens to deposit events on chain and calls event handler when one occurs

func (*EVMListener) ListenToEvents

func (l *EVMListener) ListenToEvents(ctx context.Context, epoch *big.Int)

ListenToEvents waits for new finality checkpoints and calls event handlers with the finalized epoch block range

type EventHandler

type EventHandler interface {
	HandleEvents(checkpoint *apiv1.Finality) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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