environment

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 11 Imported by: 1

Documentation

Overview

Package environment provides configuration options for loading test environments with various blockchain networks and components.

Index

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

func WithAptosContainer(t *testing.T, selectors []uint64) LoadOpt

WithAptosContainer loads Aptos blockchain container instances for specified chain selectors.

func WithAptosContainerN

func WithAptosContainerN(t *testing.T, n int) LoadOpt

WithAptosContainerN loads n Aptos blockchain container instances.

func WithEVMSimulated

func WithEVMSimulated(t *testing.T, selectors []uint64) LoadOpt

WithEVMSimulated loads simulated EVM blockchain instances for specified chain selectors.

Uses in-memory simulation without Docker containers for faster test execution.

func WithEVMSimulatedN

func WithEVMSimulatedN(t *testing.T, n int) LoadOpt

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

func WithEVMSimulatedWithConfigN(t *testing.T, n int, cfg onchain.EVMSimLoaderConfig) LoadOpt

WithEVMSimulatedWithConfigN loads n simulated EVM blockchain instances with custom configuration.

func WithLogger added in v0.50.1

func WithLogger(lggr logger.Logger) LoadOpt

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

func WithTonContainer(t *testing.T, selectors []uint64) LoadOpt

WithTonContainer loads TON blockchain container instances for specified chain selectors.

func WithTonContainerN

func WithTonContainerN(t *testing.T, n int) LoadOpt

WithTonContainerN loads n TON blockchain container instances.

func WithZKSyncContainer

func WithZKSyncContainer(t *testing.T, selectors []uint64) LoadOpt

WithZKSyncContainer loads ZKSync blockchain container instances for specified chain selectors.

func WithZKSyncContainerN

func WithZKSyncContainerN(t *testing.T, n int) LoadOpt

WithZKSyncContainerN loads n ZKSync blockchain container instances.

type Loader

type Loader struct{}

Loader instantiates a new environment with the given options.

func NewLoader

func NewLoader() *Loader

NewLoader creates a new Loader instance.

func (*Loader) Load

func (l *Loader) Load(ctx context.Context, opts ...LoadOpt) (*deployment.Environment, error)

Load loads the environment with the given options.

Jump to

Keyboard shortcuts

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