Documentation
¶
Index ¶
- func FindEnvsDir() (string, error)
- type ClientsConfig
- type ENVName
- type Env
- func (e *Env) CheckEnv(ctx context.Context) error
- func (e *Env) DockerComposeLogs(ctx context.Context, args ...string) ([]byte, error)
- func (e *Env) GetAggkitConfigPath() string
- func (e *Env) GetAggkitDataDir() string
- func (e *Env) GetAggsenderDBPath() string
- func (e *Env) RestartAggkitWithConfig(ctx context.Context, editFn func(configPath string) error) error
- func (e *Env) StartAggkit(ctx context.Context) error
- func (e *Env) Stop(ctx context.Context) error
- func (e *Env) StopAggkit(ctx context.Context) error
- func (e *Env) StopAggkitAndEditConfig(ctx context.Context, editFn func(configPath string) error) error
- type KeyPool
- type KeysConfig
- type L1Config
- type L1Contracts
- type L2Config
- type L2Contracts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindEnvsDir ¶
FindEnvsDir finds the envs directory dynamically Works when running from repo root (Makefile) or from test package directory (IDE)
Types ¶
type ClientsConfig ¶
type ClientsConfig struct {
L1 *ethclient.Client
L2 *ethclient.Client
BridgeService *client.Client
}
ClientsConfig contains RPC clients
type ENVName ¶
type ENVName string
ENVName represents a valid E2E test environment name
const ( // EnvOpPP is a testing env that has a single OP-PP network deployed EnvOpPP ENVName = "op-pp" )
type Env ¶
type Env struct {
L1 L1Config
L2 L2Config
Clients ClientsConfig
Keys KeysConfig
EnvDir string
AggsenderRPCURL string // External URL of the aggsender JSON-RPC endpoint
// contains filtered or unexported fields
}
Env represents a loaded E2E test environment
func (*Env) CheckEnv ¶
CheckEnv validates that the environment is correctly configured and all services are accessible. It is intended to be called as a pre-test sanity check in TestMain after loading the environment.
func (*Env) DockerComposeLogs ¶ added in v0.10.0
DockerComposeLogs runs "docker compose logs" with the given extra args for this environment, injecting AGGKIT_DATA_DIR so compose can resolve the bind-mount variable.
func (*Env) GetAggkitConfigPath ¶ added in v0.10.0
GetAggkitConfigPath returns the path to the aggkit config file on the host.
func (*Env) GetAggkitDataDir ¶ added in v0.10.0
GetAggkitDataDir returns the host path of the aggkit container's /tmp bind-mount directory. Files written by the container to /tmp (e.g. aggsender.sqlite, certificates/) are accessible at this path on the host.
func (*Env) GetAggsenderDBPath ¶ added in v0.10.0
GetAggsenderDBPath returns the host path to the aggsender SQLite database file. This is accessible because the aggkit container's /tmp is bind-mounted to the host.
func (*Env) RestartAggkitWithConfig ¶ added in v0.10.0
func (e *Env) RestartAggkitWithConfig(ctx context.Context, editFn func(configPath string) error) error
RestartAggkitWithConfig stops aggkit, calls editFn to modify the config, then starts aggkit. Waits for the bridge service to be ready before returning.
func (*Env) StartAggkit ¶
StartAggkit starts the aggkit service and waits for the bridge service to be ready.
func (*Env) StopAggkit ¶
StopAggkit stops only the aggkit service so the test can use the aggoracle key without conflicting with the running aggkit.
func (*Env) StopAggkitAndEditConfig ¶ added in v0.10.0
func (e *Env) StopAggkitAndEditConfig(ctx context.Context, editFn func(configPath string) error) error
StopAggkitAndEditConfig stops aggkit and calls editFn with the config file path. The caller is responsible for restarting aggkit after editing the config.
type KeyPool ¶
type KeyPool struct {
// contains filtered or unexported fields
}
KeyPool is a mutex-guarded pool of pre-funded private keys for parallel tests
func (*KeyPool) Checkout ¶
func (p *KeyPool) Checkout() (*bind.TransactOpts, *ecdsa.PrivateKey, error)
Checkout removes a key from the pool and returns transact opts and the key; caller must Return the key when done
func (*KeyPool) Return ¶
func (p *KeyPool) Return(key *ecdsa.PrivateKey)
Return returns a key to the pool so it can be checked out again
type KeysConfig ¶
type KeysConfig struct {
L1Keys *KeyPool
L2Keys *KeyPool
AggOracle *ecdsa.PrivateKey
SovereignAdmin *ecdsa.PrivateKey
}
KeysConfig exposes key pools and special keys for tests
type L1Config ¶
type L1Config struct {
ChainID *big.Int
Contracts L1Contracts
Transactor *bind.TransactOpts
}
L1Config contains L1 network configuration
type L1Contracts ¶
type L1Contracts struct {
RollupManager *agglayermanager.Agglayermanager
Bridge *agglayerbridge.Agglayerbridge
}
L1Contracts contains initialized L1 contract bindings
type L2Config ¶
type L2Config struct {
ChainID *big.Int
NetworkID uint32
Contracts L2Contracts
Transactor *bind.TransactOpts
}
L2Config contains L2 network configuration
type L2Contracts ¶
type L2Contracts struct {
L2Bridge *agglayerbridgel2.Agglayerbridgel2
L2BridgeAddress common.Address
GlobalExitRoot *agglayergerl2.Agglayergerl2
MintableERC20 *mintableerc20.Mintableerc20
MintableERC20Address common.Address
}
L2Contracts contains initialized L2 contract bindings