wait

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 22 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AndGet

func AndGet[T interface{}](ctx context.Context, pollRate time.Duration, get func() (T, error), predicate func(T) bool) (T, error)

func For

func For(ctx context.Context, rate time.Duration, cb func() (bool, error)) error

func ForBalanceChange

func ForBalanceChange(ctx context.Context, client *ethclient.Client, address common.Address, initial *big.Int) (*big.Int, error)

func ForBlock

func ForBlock(ctx context.Context, client BlockCaller, n uint64) error

func ForBlockWithTimestamp

func ForBlockWithTimestamp(ctx context.Context, client BlockCaller, target uint64) error

func ForGamePublished

func ForGamePublished(ctx context.Context, client *ethclient.Client, optimismPortalAddr common.Address, disputeGameFactoryAddr common.Address, l2BlockNumber *big.Int) (uint64, error)

ForGamePublished waits until a game is published on L1 for the given l2BlockNumber.

func ForNextBlock

func ForNextBlock(ctx context.Context, client BlockCaller) error

func ForNextSafeBlock

func ForNextSafeBlock(ctx context.Context, client BlockCaller) (*types.Block, error)

func ForNodeUp

func ForNodeUp(ctx context.Context, client *ethclient.Client, lgr log.Logger) error

func ForProcessingFullBatch

func ForProcessingFullBatch(ctx context.Context, rollupCl dial.RollupClientInterface) error

func ForReceipt

func ForReceipt(ctx context.Context, client *ethclient.Client, hash common.Hash, status uint64) (*types.Receipt, error)

func ForReceiptFail

func ForReceiptFail(ctx context.Context, client *ethclient.Client, hash common.Hash) (*types.Receipt, error)

func ForReceiptMaybe

func ForReceiptMaybe(ctx context.Context, client *ethclient.Client, hash common.Hash, status uint64, statusIgnore bool) (*types.Receipt, error)

ForReceiptMaybe waits for the receipt, but may be configured to ignore the status

func ForReceiptOK

func ForReceiptOK(ctx context.Context, client *ethclient.Client, hash common.Hash) (*types.Receipt, error)

func ForSafeBlock

func ForSafeBlock(ctx context.Context, rollupClient dial.RollupClientInterface, n uint64) error

func ForUnsafeBlock

func ForUnsafeBlock(ctx context.Context, rollupCl dial.RollupClientInterface, n uint64) error

func ForWithdrawalCheck

func ForWithdrawalCheck(ctx context.Context, client *ethclient.Client, withdrawal crossdomain.Withdrawal, optimismPortalAddr common.Address, proofSubmitter common.Address) error

ForWithdrawalCheck waits until the withdrawal check in the portal succeeds.

Types

type BlockCaller

type BlockCaller interface {
	BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
	BlockNumber(ctx context.Context) (uint64, error)
}

BlockCaller is a subset of the ethclient.Client interface encompassing methods that query for block information.

type CallTrace

type CallTrace struct {
	From    common.Address `json:"from"`
	Gas     hexutil.Uint64 `json:"gas"`
	GasUsed hexutil.Uint64 `json:"gasUsed"`
	To      common.Address `json:"to"`
	Input   hexutil.Bytes  `json:"input"`
	Output  hexutil.Bytes  `json:"output"`
	Error   string         `json:"error"`
	Value   hexutil.U256   `json:"value"`
	Type    string         `json:"type"`
}

type ReceiptStatusError

type ReceiptStatusError struct {
	Status  uint64
	TxTrace *TxTrace
}

func (*ReceiptStatusError) Error

func (rse *ReceiptStatusError) Error() string

type TxTrace

type TxTrace struct {
	CallTrace
	Calls []CallTrace `json:"calls"`
}

func DebugTraceTx

func DebugTraceTx(ctx context.Context, client *ethclient.Client, txHash common.Hash) (*TxTrace, error)

DebugTraceTx logs debug_traceTransaction output to aid in debugging unexpected receipt statuses

Jump to

Keyboard shortcuts

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