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 NewTestSnowContextWithChainID ¶
NewTestSnowContextWithChainID returns a snow.Context with validator state properly configured for testing with a specific chain ID. This is provided for backward compatibility when a specific chain ID is needed.
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