interfaces

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: GPL-3.0, LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package interfaces is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockStateCallbackListener

type MockStateCallbackListener struct {
	// contains filtered or unexported fields
}

MockStateCallbackListener is a mock of StateCallbackListener interface.

func NewMockStateCallbackListener

func NewMockStateCallbackListener(ctrl *gomock.Controller) *MockStateCallbackListener

NewMockStateCallbackListener creates a new mock instance.

func (*MockStateCallbackListener) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockStateCallbackListener) OnValidatorAdded

func (m *MockStateCallbackListener) OnValidatorAdded(arg0 ids.ID, arg1 ids.NodeID, arg2 uint64, arg3 bool)

OnValidatorAdded mocks base method.

func (*MockStateCallbackListener) OnValidatorRemoved

func (m *MockStateCallbackListener) OnValidatorRemoved(arg0 ids.ID, arg1 ids.NodeID)

OnValidatorRemoved mocks base method.

func (*MockStateCallbackListener) OnValidatorStatusUpdated

func (m *MockStateCallbackListener) OnValidatorStatusUpdated(arg0 ids.ID, arg1 ids.NodeID, arg2 bool)

OnValidatorStatusUpdated mocks base method.

type MockStateCallbackListenerMockRecorder

type MockStateCallbackListenerMockRecorder struct {
	// contains filtered or unexported fields
}

MockStateCallbackListenerMockRecorder is the mock recorder for MockStateCallbackListener.

func (*MockStateCallbackListenerMockRecorder) OnValidatorAdded

func (mr *MockStateCallbackListenerMockRecorder) OnValidatorAdded(arg0, arg1, arg2, arg3 any) *gomock.Call

OnValidatorAdded indicates an expected call of OnValidatorAdded.

func (*MockStateCallbackListenerMockRecorder) OnValidatorRemoved

func (mr *MockStateCallbackListenerMockRecorder) OnValidatorRemoved(arg0, arg1 any) *gomock.Call

OnValidatorRemoved indicates an expected call of OnValidatorRemoved.

func (*MockStateCallbackListenerMockRecorder) OnValidatorStatusUpdated

func (mr *MockStateCallbackListenerMockRecorder) OnValidatorStatusUpdated(arg0, arg1, arg2 any) *gomock.Call

OnValidatorStatusUpdated indicates an expected call of OnValidatorStatusUpdated.

type State

type State interface {
	uptime.State
	StateReader
	// AddValidator adds a new validator to the state
	AddValidator(vdr Validator) error
	// UpdateValidator updates the validator in the state
	UpdateValidator(vdr Validator) error
	// DeleteValidator deletes the validator from the state
	DeleteValidator(vID ids.ID) error
	// WriteState writes the validator state to the disk
	WriteState() error
	// RegisterListener registers a listener to the state
	RegisterListener(StateCallbackListener)
}

type StateCallbackListener

type StateCallbackListener interface {
	// OnValidatorAdded is called when a new validator is added
	OnValidatorAdded(vID ids.ID, nodeID ids.NodeID, startTime uint64, isActive bool)
	// OnValidatorRemoved is called when a validator is removed
	OnValidatorRemoved(vID ids.ID, nodeID ids.NodeID)
	// OnValidatorStatusUpdated is called when a validator status is updated
	OnValidatorStatusUpdated(vID ids.ID, nodeID ids.NodeID, isActive bool)
}

StateCallbackListener is a listener for the validator state

type StateReader

type StateReader interface {
	// GetValidator returns the validator data for the given validation ID
	GetValidator(vID ids.ID) (Validator, error)
	// GetValidationIDs returns the validation IDs in the state
	GetValidationIDs() set.Set[ids.ID]
	// GetNodeIDs returns the validator node IDs in the state
	GetNodeIDs() set.Set[ids.NodeID]
	// GetValidationID returns the validation ID for the given node ID
	GetValidationID(nodeID ids.NodeID) (ids.ID, error)
}

type Validator

type Validator struct {
	ValidationID   ids.ID     `json:"validationID"`
	NodeID         ids.NodeID `json:"nodeID"`
	Weight         uint64     `json:"weight"`
	StartTimestamp uint64     `json:"startTimestamp"`
	IsActive       bool       `json:"isActive"`
	IsL1Validator  bool       `json:"isL1Validator"`
}

Jump to

Keyboard shortcuts

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