Documentation
¶
Index ¶
- Constants
- Variables
- func ConsensusContext(ctx *consensus.Context) *consensus.Context
- func Context(tb testing.TB, chainID ids.ID) *consensus.Context
- func NewContext(tb testing.TB) *consensus.Context
- type Decidable
- type MockEngine
- type SimpleValidatorState
- func (s *SimpleValidatorState) GetCurrentHeight(ctx context.Context) (uint64, error)
- func (s *SimpleValidatorState) GetCurrentValidators(ctx context.Context, height uint64, netID ids.ID) (map[ids.NodeID]*validators.GetValidatorOutput, error)
- func (s *SimpleValidatorState) GetValidatorSet(ctx context.Context, height uint64, netID ids.ID) (map[ids.NodeID]*validators.GetValidatorOutput, error)
- func (s *SimpleValidatorState) GetWarpValidatorSet(ctx context.Context, height uint64, netID ids.ID) (*validators.WarpSet, error)
- func (s *SimpleValidatorState) GetWarpValidatorSets(ctx context.Context, heights []uint64, netIDs []ids.ID) (map[ids.ID]map[uint64]*validators.WarpSet, error)
- type TestConfig
Constants ¶
const ( Unknown uint8 = 0 Processing uint8 = 1 Rejected uint8 = 2 Accepted uint8 = 3 )
Block status constants (must match choices.Status enum)
Variables ¶
var ( PChainID = ids.GenerateTestID() XChainID = ids.GenerateTestID() CChainID = ids.GenerateTestID() // Use fixed asset ID to match genesistest.LUXAssetID for UTXO consistency XAssetID = ids.ID{'l', 'u', 'x', ' ', 'a', 's', 's', 'e', 't', ' ', 'i', 'd'} )
Functions ¶
func ConsensusContext ¶
ConsensusContext updates a consensus context with default test values
Types ¶
type Decidable ¶
Decidable is an embedded struct for test blocks
type MockEngine ¶
MockEngine is a mock consensus engine
func (*MockEngine) HealthCheck ¶
func (m *MockEngine) HealthCheck(ctx context.Context) (interface{}, error)
HealthCheck performs health check
func (*MockEngine) IsBootstrapped ¶
func (m *MockEngine) IsBootstrapped() bool
IsBootstrapped returns bootstrap status
type SimpleValidatorState ¶
type SimpleValidatorState struct{}
SimpleValidatorState is a minimal validator state for testing
func (*SimpleValidatorState) GetCurrentHeight ¶
func (s *SimpleValidatorState) GetCurrentHeight(ctx context.Context) (uint64, error)
GetCurrentHeight returns height 0 for testing
func (*SimpleValidatorState) GetCurrentValidators ¶ added in v1.22.2
func (s *SimpleValidatorState) GetCurrentValidators(ctx context.Context, height uint64, netID ids.ID) (map[ids.NodeID]*validators.GetValidatorOutput, error)
GetCurrentValidators returns an empty validator set for testing
func (*SimpleValidatorState) GetValidatorSet ¶
func (s *SimpleValidatorState) GetValidatorSet(ctx context.Context, height uint64, netID ids.ID) (map[ids.NodeID]*validators.GetValidatorOutput, error)
GetValidatorSet returns an empty validator set for testing
func (*SimpleValidatorState) GetWarpValidatorSet ¶ added in v1.22.2
func (s *SimpleValidatorState) GetWarpValidatorSet(ctx context.Context, height uint64, netID ids.ID) (*validators.WarpSet, error)
GetWarpValidatorSet returns an empty warp validator set for testing
func (*SimpleValidatorState) GetWarpValidatorSets ¶ added in v1.22.2
func (s *SimpleValidatorState) GetWarpValidatorSets(ctx context.Context, heights []uint64, netIDs []ids.ID) (map[ids.ID]map[uint64]*validators.WarpSet, error)
GetWarpValidatorSets returns empty warp validator sets for testing
type TestConfig ¶
TestConfig provides test configuration
func NewTestConfig ¶
func NewTestConfig(t *testing.T) *TestConfig
NewTestConfig creates a test config