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) (*fdeployment.Environment, error)
- type LoadOpt
- func WithAddressBook(ab fdeployment.AddressBook) LoadOpt
- func WithAptosContainer(t *testing.T, selectors []uint64) LoadOpt
- func WithAptosContainerN(t *testing.T, n int) LoadOpt
- func WithChains(chains ...fchain.BlockChain) LoadOpt
- func WithDatastore(ds fdatastore.DataStore) 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 WithNodeIDs(nodeIDs []string) LoadOpt
- func WithOffchainClient(oc offchain.Client) 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 WithSuiContainer(t *testing.T, selectors []uint64) LoadOpt
- func WithSuiContainerN(t *testing.T, n int) LoadOpt
- func WithTonContainer(t *testing.T, selectors []uint64) LoadOpt
- func WithTonContainerN(t *testing.T, n int) LoadOpt
- func WithTronContainer(t *testing.T, selectors []uint64) LoadOpt
- func WithTronContainerN(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.0
func New(ctx context.Context, opts ...LoadOpt) (*fdeployment.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 WithAddressBook ¶ added in v0.56.0
func WithAddressBook(ab fdeployment.AddressBook) LoadOpt
WithAddressBook sets a custom address book for the environment.
func WithAptosContainer ¶
WithAptosContainer loads Aptos blockchain container instances for specified chain selectors.
func WithAptosContainerN ¶
WithAptosContainerN loads n Aptos blockchain container instances.
func WithChains ¶ added in v0.69.0
func WithChains(chains ...fchain.BlockChain) LoadOpt
WithChains adds pre-constructed blockchain instances to the environment.
Use this option when you need to manually construct and configure chains before adding them to the environment. For most test scenarios, prefer using chain-specific loaders like WithEVMSimulated, WithSolanaContainer, etc., which handle chain setup automatically.
func WithDatastore ¶ added in v0.56.0
func WithDatastore(ds fdatastore.DataStore) LoadOpt
WithDatastore sets a custom datastore for the environment.
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.0
WithLogger sets the logger for the environment.
func WithNodeIDs ¶ added in v0.57.0
WithNodeIDs sets a custom node IDs for the environment.
func WithOffchainClient ¶ added in v0.56.0
WithOffchainClient sets a custom offchain client 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 WithSuiContainer ¶ added in v0.53.0
WithSuiContainer loads Sui blockchain container instances for specified chain selectors.
func WithSuiContainerN ¶ added in v0.53.0
WithSuiContainerN loads n Sui blockchain container instances.
func WithTonContainer ¶
WithTonContainer loads TON blockchain container instances for specified chain selectors.
func WithTonContainerN ¶
WithTonContainerN loads n TON blockchain container instances.
func WithTronContainer ¶ added in v0.53.0
WithTronContainer loads Tron blockchain container instances for specified chain selectors.
func WithTronContainerN ¶ added in v0.53.0
WithTronContainerN loads n Tron blockchain container instances.
func WithZKSyncContainer ¶
WithZKSyncContainer loads ZKSync blockchain container instances for specified chain selectors.