Documentation
¶
Overview ¶
Package environment provides configuration options for loading test environments with various blockchain networks and components.
Index ¶
- func New(ctx context.Context, opts ...LoadOpt) (*deployment.Environment, error)
- type LoadOpt
- func WithAptosContainer(t *testing.T, selectors []uint64) LoadOpt
- func WithAptosContainerN(t *testing.T, n int) LoadOpt
- func WithEVMSimulated(t *testing.T, selectors []uint64) LoadOpt
- func WithEVMSimulatedN(t *testing.T, n int) LoadOpt
- func WithEVMSimulatedWithConfig(t *testing.T, selectors []uint64, cfg onchain.EVMSimLoaderConfig) LoadOpt
- func WithEVMSimulatedWithConfigN(t *testing.T, n int, cfg onchain.EVMSimLoaderConfig) LoadOpt
- func WithLogger(lggr logger.Logger) LoadOpt
- func WithSolanaContainer(t *testing.T, selectors []uint64, programsPath string, ...) LoadOpt
- func WithSolanaContainerN(t *testing.T, n int, programsPath string, programIDs map[string]string) LoadOpt
- func WithTonContainer(t *testing.T, selectors []uint64) LoadOpt
- func WithTonContainerN(t *testing.T, n int) LoadOpt
- func WithZKSyncContainer(t *testing.T, selectors []uint64) LoadOpt
- func WithZKSyncContainerN(t *testing.T, n int) LoadOpt
- type Loader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶ added in v0.50.1
func New(ctx context.Context, opts ...LoadOpt) (*deployment.Environment, error)
New creates a new environment for testing.
It loads the environment with the given options and returns the environment.
If the environment fails to load, it returns an error.
Types ¶
type LoadOpt ¶
type LoadOpt func(*components) error
LoadOpt is a configuration function that sets environment components during loading.
func WithAptosContainer ¶
WithAptosContainer loads Aptos blockchain container instances for specified chain selectors.
func WithAptosContainerN ¶
WithAptosContainerN loads n Aptos blockchain container instances.
func WithEVMSimulated ¶
WithEVMSimulated loads simulated EVM blockchain instances for specified chain selectors.
Uses in-memory simulation without Docker containers for faster test execution.
func WithEVMSimulatedN ¶
WithEVMSimulatedN loads n simulated EVM blockchain instances.
func WithEVMSimulatedWithConfig ¶
func WithEVMSimulatedWithConfig(t *testing.T, selectors []uint64, cfg onchain.EVMSimLoaderConfig) LoadOpt
WithEVMSimulatedWithConfig loads simulated EVM blockchain instances with custom configuration for specified chain selectors.
func WithEVMSimulatedWithConfigN ¶
WithEVMSimulatedWithConfigN loads n simulated EVM blockchain instances with custom configuration.
func WithLogger ¶ added in v0.50.1
WithLogger sets the logger for the environment.
func WithSolanaContainer ¶
func WithSolanaContainer( t *testing.T, selectors []uint64, programsPath string, programIDs map[string]string, ) LoadOpt
WithSolanaContainer loads Solana blockchain container instances for specified chain selectors.
Requires programsPath and programIDs for initial container setup.
func WithSolanaContainerN ¶
func WithSolanaContainerN( t *testing.T, n int, programsPath string, programIDs map[string]string, ) LoadOpt
WithSolanaContainerN loads n Solana blockchain instances using Docker containers.
Requires programsPath and programIDs for initial container setup.
func WithTonContainer ¶
WithTonContainer loads TON blockchain container instances for specified chain selectors.
func WithTonContainerN ¶
WithTonContainerN loads n TON blockchain container instances.
func WithZKSyncContainer ¶
WithZKSyncContainer loads ZKSync blockchain container instances for specified chain selectors.