Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SubnetEVMTestChainID = ids.GenerateTestID()
SubnetEVMTestChainID is a evm specific chain ID for testing
Functions ¶
func NewTestConsensusContext ¶ added in v0.8.6
NewTestConsensusContext returns a consensus.Context with validator state properly configured for testing. This wraps consensustest.Context and sets the validator state to avoid the missing GetValidatorSetF issue.
Usage example:
// Instead of: // consensusCtx := utilstest.NewTestConsensusContext(t, consensustest.CChainID) // validatorState := utils.NewTestValidatorState() // consensusCtx.ValidatorState = validatorState // Use: consensusCtx := utils.NewTestConsensusContext(t)
This function ensures that the consensus context has a properly configured validator state that includes the GetValidatorSetF function, which is required by many tests.
func NewTestConsensusContextWithChainID ¶ added in v0.8.6
NewTestConsensusContextWithChainID returns a consensus.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 ¶ added in v0.8.4
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