Documentation
¶
Index ¶
- type State
- type TestState
- func (s *TestState) GetCurrentHeight(ctx context.Context) (uint64, error)
- func (s *TestState) GetCurrentValidators(ctx context.Context, height uint64, netID ids.ID) (map[ids.NodeID]*validators.GetValidatorOutput, error)
- func (s *TestState) GetValidatorSet(ctx context.Context, height uint64, netID ids.ID) (map[ids.NodeID]*validators.GetValidatorOutput, error)
- func (s *TestState) GetWarpValidatorSet(ctx context.Context, height uint64, netID ids.ID) (*validators.WarpSet, error)
- func (s *TestState) GetWarpValidatorSets(ctx context.Context, heights []uint64, netIDs []ids.ID) (map[ids.ID]map[uint64]*validators.WarpSet, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestState ¶
type TestState struct {
// Function fields for test customization
GetCurrentHeightF func(context.Context) (uint64, error)
GetValidatorSetF func(context.Context, uint64, ids.ID) (map[ids.NodeID]*validators.GetValidatorOutput, error)
GetWarpValidatorSetF func(context.Context, uint64, ids.ID) (*validators.WarpSet, error)
GetWarpValidatorSetsF func(context.Context, []uint64, []ids.ID) (map[ids.ID]map[uint64]*validators.WarpSet, error)
// contains filtered or unexported fields
}
TestState is a test implementation of validators.State
func (*TestState) GetCurrentHeight ¶
GetCurrentHeight returns the current height
func (*TestState) GetCurrentValidators ¶
func (s *TestState) GetCurrentValidators(ctx context.Context, height uint64, netID ids.ID) (map[ids.NodeID]*validators.GetValidatorOutput, error)
GetCurrentValidators returns current validators
func (*TestState) GetValidatorSet ¶
func (s *TestState) GetValidatorSet(ctx context.Context, height uint64, netID ids.ID) (map[ids.NodeID]*validators.GetValidatorOutput, error)
GetValidatorSet returns a validator set
Click to show internal directories.
Click to hide internal directories.