client

package
v0.0.0-...-d4adcb1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SubscribeHeaderMapped

func SubscribeHeaderMapped[T any, U Iterable](
	ctx context.Context,
	broker *utils.Broker[*types.Header],
	fn func(*bind.FilterOpts) (U, error),
	start uint64,
) <-chan T

Subscribes to a channel that emits events mapped from fn applied to a Header broker's events.

Types

type EthBridgeClient

type EthBridgeClient struct {
	*eth.EthClient
	// contains filtered or unexported fields
}

func NewEthBridgeClient

func NewEthBridgeClient(
	ctx context.Context,
	l1Endpoint string,
	sequencerInboxAddress common.Address,
	retryOpts []retry.Option,
) (*EthBridgeClient, error)

func (*EthBridgeClient) FilterTxBatchAppendedEvents

func (c *EthBridgeClient) FilterTxBatchAppendedEvents(
	opts *bind.FilterOpts,
) (*bindings.ISequencerInboxTxBatchAppendedIterator, error)

type Iterable

type Iterable interface {
	Next() bool
	Error() error
	Close() error
}

Interface used to represent Iterators from `bindings`

type L1BridgeClient

type L1BridgeClient interface {
	TransactionByHash(ctx context.Context, hash common.Hash) (*types.Transaction, bool, error)
	HeaderByTag(ctx context.Context, tag eth.BlockTag) (*types.Header, error)
	BlockNumber(ctx context.Context) (uint64, error)
	FilterTxBatchAppendedEvents(opts *bind.FilterOpts) (*bindings.ISequencerInboxTxBatchAppendedIterator, error)
}

TODO: delete this file

type L1Syncer

type L1Syncer struct {
	Latest    *types.Header
	Finalized *types.Header

	LatestHeaderBroker    *utils.Broker[*types.Header]
	FinalizedHeaderBroker *utils.Broker[*types.Header]
	// contains filtered or unexported fields
}

func NewL1Syncer

func NewL1Syncer(ctx context.Context, l1Client L1BridgeClient) *L1Syncer

func (*L1Syncer) Start

func (s *L1Syncer) Start(ctx context.Context)

Jump to

Keyboard shortcuts

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