l1

package
v0.0.0-...-eb934a0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MIT, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HintL1BlockHeader  = "l1-block-header"
	HintL1Transactions = "l1-transactions"
	HintL1Receipts     = "l1-receipts"
)

Variables

View Source
var (
	ErrNotFound     = ethereum.NotFound
	ErrUnknownLabel = errors.New("unknown label")
)

Functions

This section is empty.

Types

type BlockHeaderHint

type BlockHeaderHint common.Hash

func (BlockHeaderHint) Hint

func (l BlockHeaderHint) Hint() string

type CachingOracle

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

CachingOracle is an implementation of Oracle that delegates to another implementation, adding caching of all results

func NewCachingOracle

func NewCachingOracle(oracle Oracle) *CachingOracle

func (*CachingOracle) HeaderByBlockHash

func (o *CachingOracle) HeaderByBlockHash(blockHash common.Hash) eth.BlockInfo

func (*CachingOracle) ReceiptsByBlockHash

func (o *CachingOracle) ReceiptsByBlockHash(blockHash common.Hash) (eth.BlockInfo, types.Receipts)

func (*CachingOracle) TransactionsByBlockHash

func (o *CachingOracle) TransactionsByBlockHash(blockHash common.Hash) (eth.BlockInfo, types.Transactions)

type Oracle

type Oracle interface {
	// HeaderByBlockHash retrieves the block header with the given hash.
	HeaderByBlockHash(blockHash common.Hash) eth.BlockInfo

	// TransactionsByBlockHash retrieves the transactions from the block with the given hash.
	TransactionsByBlockHash(blockHash common.Hash) (eth.BlockInfo, types.Transactions)

	// ReceiptsByBlockHash retrieves the receipts from the block with the given hash.
	ReceiptsByBlockHash(blockHash common.Hash) (eth.BlockInfo, types.Receipts)
}

type OracleL1Client

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

func NewOracleL1Client

func NewOracleL1Client(logger log.Logger, oracle Oracle, l1Head common.Hash) *OracleL1Client

func (*OracleL1Client) FetchReceipts

func (o *OracleL1Client) FetchReceipts(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Receipts, error)

func (*OracleL1Client) InfoAndTxsByHash

func (o *OracleL1Client) InfoAndTxsByHash(ctx context.Context, hash common.Hash) (eth.BlockInfo, types.Transactions, error)

func (*OracleL1Client) InfoByHash

func (o *OracleL1Client) InfoByHash(ctx context.Context, hash common.Hash) (eth.BlockInfo, error)

func (*OracleL1Client) L1BlockRefByHash

func (o *OracleL1Client) L1BlockRefByHash(ctx context.Context, hash common.Hash) (eth.L1BlockRef, error)

func (*OracleL1Client) L1BlockRefByLabel

func (o *OracleL1Client) L1BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (eth.L1BlockRef, error)

func (*OracleL1Client) L1BlockRefByNumber

func (o *OracleL1Client) L1BlockRefByNumber(ctx context.Context, number uint64) (eth.L1BlockRef, error)

type PreimageOracle

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

PreimageOracle implements Oracle using by interfacing with the pure preimage.Oracle to fetch pre-images to decode into the requested data.

func NewPreimageOracle

func NewPreimageOracle(raw preimage.Oracle, hint preimage.Hinter) *PreimageOracle

func (*PreimageOracle) HeaderByBlockHash

func (p *PreimageOracle) HeaderByBlockHash(blockHash common.Hash) eth.BlockInfo

func (*PreimageOracle) ReceiptsByBlockHash

func (p *PreimageOracle) ReceiptsByBlockHash(blockHash common.Hash) (eth.BlockInfo, types.Receipts)

func (*PreimageOracle) TransactionsByBlockHash

func (p *PreimageOracle) TransactionsByBlockHash(blockHash common.Hash) (eth.BlockInfo, types.Transactions)

type ReceiptsHint

type ReceiptsHint common.Hash

func (ReceiptsHint) Hint

func (l ReceiptsHint) Hint() string

type TransactionsHint

type TransactionsHint common.Hash

func (TransactionsHint) Hint

func (l TransactionsHint) Hint() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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