Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SubnetEVMTestChainID = ids.GenerateTestID()
SubnetEVMTestChainID is a subnet-evm specific chain ID for testing
Functions ¶
func NewTestSnowContext ¶
NewTestSnowContext returns a snow.Context with validator state properly configured for testing. This wraps snowtest.Context and sets the validator state to avoid the missing GetValidatorSetF issue.
Usage example:
// Instead of: // snowCtx := utilstest.NewTestSnowContext(t, snowtest.CChainID) // validatorState := utils.NewTestValidatorState() // snowCtx.ValidatorState = validatorState // Use: snowCtx := utils.NewTestSnowContext(t)
This function ensures that the snow context has a properly configured validator state that includes the GetValidatorSetF function, which is required by many tests.
func NewTestSnowContextWithValidatorState ¶
func NewTestSnowContextWithValidatorState(t testing.TB, validatorState validators.State) *snow.Context
NewTestSnowContextWithValidatorState returns a snow.Context with the provided validator state. This is useful when you need to customize the validator state behavior for specific tests.
func NewTestValidatorState ¶
func NewTestValidatorState() *validatorstest.State
@TODO: This should eventually be replaced by a more robust solution, or alternatively, the presence of nil validator states shouldn't be depended upon by tests