onchain

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: 12 Imported by: 1

Documentation

Overview

Package onchain provides chain loaders for testing infrastructure.

Package onchain provides chain loaders for testing infrastructure.

Package onchain provides chain loaders for testing infrastructure.

Package onchain provides chain loaders for testing infrastructure.

Package onchain provides chain loaders for testing infrastructure.

Index

Constants

This section is empty.

Variables

View Source
var ErrMaxSelectorsReached = errors.New("max selectors reached")

ErrMaxSelectorsReached is returned when the user requests more selectors than are available from the predefined test selectors.

Functions

This section is empty.

Types

type ChainFactory

type ChainFactory func(t *testing.T, selector uint64) (fchain.BlockChain, error)

ChainFactory is a function type that creates a single chain for a given selector.

type ChainLoader

type ChainLoader struct {
	// contains filtered or unexported fields
}

ChainLoader provides functionality to load multiple chains in parallel.

func NewAptosContainerLoader

func NewAptosContainerLoader() *ChainLoader

NewAptosContainerLoader creates a new Aptos chain loader with default configuration using CTF.

func NewChainLoader

func NewChainLoader(selectors []uint64, factory ChainFactory) *ChainLoader

NewChainLoader creates a new ChainLoader with the given selectors and factory.

func NewEVMSimLoader

func NewEVMSimLoader() *ChainLoader

NewEVMSimLoader creates a new EVM chain loader with default simulated backend configuration. Uses go-ethereum's simulated backend with default settings for fast test execution.

func NewEVMSimLoaderWithConfig

func NewEVMSimLoaderWithConfig(cfg EVMSimLoaderConfig) *ChainLoader

NewEVMSimLoaderWithConfig creates a new EVM chain loader with custom configuration. Allows specification of additional accounts and block mining intervals for advanced testing scenarios.

func NewSolanaContainerLoader

func NewSolanaContainerLoader(
	programsPath string, programIDs map[string]string,
) *ChainLoader

NewSolanaContainerLoader creates a new Solana chain loader with program configuration using CTF. The programsPath specifies the directory containing Solana programs, and programIDs maps program names to their deployment addresses.

func NewTonContainerLoader

func NewTonContainerLoader() *ChainLoader

NewTonContainerLoader creates a new TON chain loader with default configuration using CTF.

func NewZKSyncContainerLoader

func NewZKSyncContainerLoader() *ChainLoader

NewZKSyncContainerLoader creates a new ZKSync EVM chain loader with predefined test selectors using CTF.

ZKSync chains use dedicated test selectors starting from TEST_90000051 to avoid conflicts with standard EVM test selectors. The loader supports up to 10 concurrent ZKSync test chains.

func (*ChainLoader) Load

func (l *ChainLoader) Load(t *testing.T, selectors []uint64) ([]fchain.BlockChain, error)

Load creates multiple chains for the specified selectors.

func (*ChainLoader) LoadN

func (l *ChainLoader) LoadN(t *testing.T, n int) ([]fchain.BlockChain, error)

LoadN loads the first n available test Aptos chains.

type EVMSimLoaderConfig

type EVMSimLoaderConfig struct {
	NumAdditionalAccounts uint          // Number of additional pre-funded accounts to create
	BlockTime             time.Duration // Time interval between automatic block mining (0 = manual)
}

EVMSimLoaderConfig holds configuration options for EVM simulated chain loading.

Jump to

Keyboard shortcuts

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