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) GetChainID(chainID ids.ID) (ids.ID, error)
- func (s *SimpleValidatorState) GetCurrentHeight() (uint64, error)
- func (s *SimpleValidatorState) GetMinimumHeight(ctx context.Context) (uint64, error)
- func (s *SimpleValidatorState) GetNetID(chainID ids.ID) (ids.ID, error)
- func (s *SimpleValidatorState) GetSubnetID(chainID ids.ID) (ids.ID, error)
- func (s *SimpleValidatorState) GetValidatorSet(height uint64, subnetID ids.ID) (map[ids.NodeID]uint64, error)
- type TestConfig
Constants ¶
View Source
const ( Unknown uint8 = 0 Processing uint8 = 1 Accepted uint8 = 2 Rejected uint8 = 3 )
Block status constants
Variables ¶
View Source
var ( PChainID = ids.GenerateTestID() XChainID = ids.GenerateTestID() CChainID = ids.GenerateTestID() LUXAssetID = ids.GenerateTestID() )
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) GetChainID ¶
func (*SimpleValidatorState) GetCurrentHeight ¶
func (s *SimpleValidatorState) GetCurrentHeight() (uint64, error)
func (*SimpleValidatorState) GetMinimumHeight ¶
func (s *SimpleValidatorState) GetMinimumHeight(ctx context.Context) (uint64, error)
func (*SimpleValidatorState) GetSubnetID ¶
func (*SimpleValidatorState) GetValidatorSet ¶
type TestConfig ¶
TestConfig provides test configuration
func NewTestConfig ¶
func NewTestConfig(t *testing.T) *TestConfig
NewTestConfig creates a test config
Click to show internal directories.
Click to hide internal directories.