validatorstest

package
v1.22.41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2025 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State = TestState

State is an alias for TestState for backward compatibility

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 NewTestState

func NewTestState() *TestState

NewTestState creates a new test state

func (*TestState) GetCurrentHeight

func (s *TestState) GetCurrentHeight(ctx context.Context) (uint64, error)

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

func (*TestState) GetWarpValidatorSet added in v1.22.0

func (s *TestState) GetWarpValidatorSet(ctx context.Context, height uint64, netID ids.ID) (*validators.WarpSet, error)

GetWarpValidatorSet returns the Warp validator set for a specific height and netID

func (*TestState) GetWarpValidatorSets added in v1.22.0

func (s *TestState) GetWarpValidatorSets(ctx context.Context, heights []uint64, netIDs []ids.ID) (map[ids.ID]map[uint64]*validators.WarpSet, error)

GetWarpValidatorSets returns Warp validator sets for the requested heights and netIDs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL