Documentation
¶
Index ¶
- Variables
- func ConnectP2P(t *testing.T, node1 *ethclient.Client, node2 *ethclient.Client)
- func FindBlock(client *ethclient.Client, from, to int, timeout time.Duration, ...) (*types.Block, error)
- func InitL1(blockTime uint64, finalizedDistance uint64, genesis *core.Genesis, ...) (*GethInstance, *FakePoS, error)
- func WaitForBlock(number *big.Int, client *ethclient.Client, opts ...WaitForBlockOption) (*types.Block, error)
- func WaitForBlockToBeFinalized(number *big.Int, client *ethclient.Client, timeout time.Duration) (*types.Block, error)
- func WaitForBlockToBeSafe(number *big.Int, client *ethclient.Client, timeout time.Duration) (*types.Block, error)
- func WaitForL1OriginOnL2(rollupCfg *rollup.Config, l1BlockNum uint64, client *ethclient.Client, ...) (*types.Block, error)
- func WaitForTransaction(hash common.Hash, client *ethclient.Client, timeout time.Duration) (*types.Receipt, error)
- func WithP2P() func(ethCfg *ethconfig.Config, nodeCfg *node.Config) error
- type Beacon
- type FakePoS
- type GethInstance
- type GethOption
- type WaitForBlockOption
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not found")
Functions ¶
func ConnectP2P ¶
ConnectP2P creates a p2p peer connection between node1 and node2.
func FindBlock ¶
func FindBlock(client *ethclient.Client, from, to int, timeout time.Duration, pred func(*types.Block) (bool, error), ) (*types.Block, error)
FindBlock finds the first block for which the predicate [pred] matches and returns it. It starts at [from] and iterates until [to], inclusively, using the provided [client]. It supports both search directions, forwards and backwards.
func WaitForBlock ¶
func WaitForBlock(number *big.Int, client *ethclient.Client, opts ...WaitForBlockOption) (*types.Block, error)
WaitForBlock waits for the chain to advance to the provided block number. It can be configured with two different timeout: an absolute timeout, and a no change timeout. The absolute timeout caps the maximum amount of time this method will run. The no change timeout will return an error if the block number does not change within that time window. This is useful to bail out early in the event of a stuck chain, but allow things to continue if the chain is still advancing.
This function will also retry fetch errors up to three times before returning an error in order to protect against transient network problems. This function uses polling rather than websockets.
func WaitForBlockToBeSafe ¶
func WaitForL1OriginOnL2 ¶
func WaitForTransaction ¶
Types ¶
type Beacon ¶
type Beacon interface {
StoreBlobsBundle(slot uint64, bundle *engine.BlobsBundleV1) error
}
type FakePoS ¶
type FakePoS struct {
// contains filtered or unexported fields
}
fakePoS is a testing-only utility to attach to Geth, to build a fake proof-of-stake L1 chain with fixed block time and basic lagging safe/finalized blocks.
func (*FakePoS) FakeBeaconBlockRoot ¶
type GethInstance ¶
func InitL2 ¶
func InitL2(name string, genesis *core.Genesis, jwtPath string, opts ...GethOption) (*GethInstance, error)
InitL2 inits a L2 geth node.
func (*GethInstance) AuthRPC ¶
func (gi *GethInstance) AuthRPC() endpoint.RPC
func (*GethInstance) Close ¶
func (gi *GethInstance) Close() error
func (*GethInstance) UserRPC ¶
func (gi *GethInstance) UserRPC() endpoint.RPC
type WaitForBlockOption ¶
type WaitForBlockOption func(*waitForBlockOptions)
func WithAbsoluteTimeout ¶
func WithAbsoluteTimeout(timeout time.Duration) WaitForBlockOption
func WithNoChangeTimeout ¶
func WithNoChangeTimeout(timeout time.Duration) WaitForBlockOption