Help us shape the future of Go! Take the 2026 Go Developer Survey

validatorstest

package
v1.22.65 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 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)
	// 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

Jump to

Keyboard shortcuts

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