Documentation
¶
Index ¶
- func ApplyDeployConfigForks(deployConfig *genesis.DeployConfig)
- func CollectAddresses(sd *SetupData, dp *DeployParams) (out []common.Address)
- func Ether(v uint64) *big.Int
- func GetL2AllocsMode(dc *genesis.DeployConfig, t uint64) genesis.L2AllocsMode
- func SystemConfigFromDeployConfig(deployConfig *genesis.DeployConfig) eth.SystemConfig
- func TimeoutCtx(t *testing.T, timeout time.Duration) context.Context
- func WriteDefaultJWT(t TestingBase) string
- type AllocParams
- type DeployParams
- type SetupData
- type TestParams
- type TestingBase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyDeployConfigForks ¶ added in v1.5.0
func ApplyDeployConfigForks(deployConfig *genesis.DeployConfig)
func CollectAddresses ¶
func CollectAddresses(sd *SetupData, dp *DeployParams) (out []common.Address)
CollectAddresses constructs a lists of addresses that may be used as fuzzing corpora or random address selection.
func Ether ¶
Ether converts a uint64 Ether amount into a *big.Int amount in wei units, for allocating test balances.
func GetL2AllocsMode ¶ added in v1.9.5
func GetL2AllocsMode(dc *genesis.DeployConfig, t uint64) genesis.L2AllocsMode
func SystemConfigFromDeployConfig ¶
func SystemConfigFromDeployConfig(deployConfig *genesis.DeployConfig) eth.SystemConfig
func WriteDefaultJWT ¶
func WriteDefaultJWT(t TestingBase) string
WriteDefaultJWT writes a testing JWT to the temporary directory of the test and returns the path to the JWT file.
Types ¶
type AllocParams ¶
type AllocParams struct {
L1Alloc types.GenesisAlloc
L2Alloc types.GenesisAlloc
PrefundTestUsers bool
}
AllocParams defines genesis allocations to apply on top of the genesis generated by deploy parameters. These allocations override existing allocations per account, i.e. the allocations are merged with AllocParams having priority.
type DeployParams ¶
type DeployParams struct {
DeployConfig *genesis.DeployConfig
MnemonicConfig *secrets.MnemonicConfig
Secrets *secrets.Secrets
Addresses *secrets.Addresses
AllocType config.AllocType
}
DeployParams bundles the deployment parameters to generate further testing inputs with.
func MakeDeployParams ¶
func MakeDeployParams(t require.TestingT, tp *TestParams) *DeployParams
type SetupData ¶
type SetupData struct {
L1Cfg *core.Genesis
L2Cfg *core.Genesis
RollupCfg *rollup.Config
DependencySet depset.DependencySet
ChainSpec *rollup.ChainSpec
DeploymentsL1 *genesis.L1Deployments
}
SetupData bundles the L1, L2, rollup and deployment configuration data: everything for a full test setup.
func Setup ¶
func Setup(t require.TestingT, deployParams *DeployParams, alloc *AllocParams) *SetupData
Setup computes the testing setup configurations from deployment configuration and optional allocation parameters.
type TestParams ¶
type TestParams struct {
MaxSequencerDrift uint64
SequencerWindowSize uint64
ChannelTimeout uint64
L1BlockTime uint64
UseAltDA bool
AllocType config.AllocType
}
TestParams parametrizes the most essential rollup configuration parameters
type TestingBase ¶
type TestingBase interface {
Cleanup(func())
Error(args ...any)
Errorf(format string, args ...any)
Fail()
FailNow()
Failed() bool
Fatal(args ...any)
Fatalf(format string, args ...any)
Helper()
Log(args ...any)
Logf(format string, args ...any)
Name() string
Setenv(key, value string)
Skip(args ...any)
SkipNow()
Skipf(format string, args ...any)
Skipped() bool
TempDir() string
Parallel()
}
TestingBase is an interface used for standard Go testing. This interface is used for unit tests, benchmarks, and fuzz tests and also emulated in Hive.
The Go testing.TB interface does not allow extensions by embedding the interface, so we repeat it here.