types

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockNotifier

type BlockNotifier interface {
	// NotifyEpochStarted notifies the epoch has started.
	Subscribe(id string) <-chan EventNewBlock
	String() string
}

BlockNotifier is the interface that wraps the basic methods to notify a new block.

type BridgeL2Syncer

type BridgeL2Syncer interface {
}

type CertificateInfo

type CertificateInfo struct {
	Height            uint64                     `meddler:"height"`
	CertificateID     common.Hash                `meddler:"certificate_id,hash"`
	NewLocalExitRoot  common.Hash                `meddler:"new_local_exit_root,hash"`
	FromBlock         uint64                     `meddler:"from_block"`
	ToBlock           uint64                     `meddler:"to_block"`
	Status            agglayer.CertificateStatus `meddler:"status"`
	CreatedAt         int64                      `meddler:"created_at"`
	UpdatedAt         int64                      `meddler:"updated_at"`
	SignedCertificate string                     `meddler:"signed_certificate"`
}

func (CertificateInfo) String

func (c CertificateInfo) String() string

type EpochEvent

type EpochEvent struct {
	Epoch uint64
	// ExtraInfo if a detailed information about the epoch that depends on implementation
	ExtraInfo fmt.Stringer
}

EpochEvent is the event that notifies the neear end epoch

func (EpochEvent) String

func (e EpochEvent) String() string

type EpochNotifier

type EpochNotifier interface {
	// NotifyEpochStarted notifies the epoch is close to end.
	Subscribe(id string) <-chan EpochEvent
	// Start starts the notifier synchronously
	Start(ctx context.Context)
	String() string
}

type EthClient

type EthClient interface {
	BlockNumber(ctx context.Context) (uint64, error)
	HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
}

EthClient is an interface defining functions that an EthClient should implement

type EventNewBlock

type EventNewBlock struct {
	BlockNumber       uint64
	BlockFinalityType etherman.BlockNumberFinality
}

type GenericSubscriber

type GenericSubscriber[T any] interface {
	Subscribe(subscriberName string) <-chan T
	Publish(data T)
}

type L1InfoTreeSyncer

type L1InfoTreeSyncer interface {
	GetInfoByGlobalExitRoot(globalExitRoot common.Hash) (*l1infotreesync.L1InfoTreeLeaf, error)
	GetL1InfoTreeMerkleProofFromIndexToRoot(
		ctx context.Context, index uint32, root common.Hash,
	) (treeTypes.Proof, error)
	GetL1InfoTreeRootByIndex(ctx context.Context, index uint32) (treeTypes.Root, error)
}

L1InfoTreeSyncer is an interface defining functions that an L1InfoTreeSyncer should implement

type L2BridgeSyncer

type L2BridgeSyncer interface {
	GetBlockByLER(ctx context.Context, ler common.Hash) (uint64, error)
	GetExitRootByIndex(ctx context.Context, index uint32) (treeTypes.Root, error)
	GetBridgesPublished(ctx context.Context, fromBlock, toBlock uint64) ([]bridgesync.Bridge, error)
	GetClaims(ctx context.Context, fromBlock, toBlock uint64) ([]bridgesync.Claim, error)
	OriginNetwork() uint32
	BlockFinality() etherman.BlockNumberFinality
	GetLastProcessedBlock(ctx context.Context) (uint64, error)
}

L2BridgeSyncer is an interface defining functions that an L2BridgeSyncer should implement

type Logger

type Logger interface {
	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	Warn(args ...interface{})
	Warnf(format string, args ...interface{})
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
}

Logger is an interface that defines the methods to log messages

Jump to

Keyboard shortcuts

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