Documentation ¶
Overview ¶
Package interfaces is a generated GoMock package.
Index ¶
- type MockStateCallbackListener
- func (m *MockStateCallbackListener) EXPECT() *MockStateCallbackListenerMockRecorder
- func (m *MockStateCallbackListener) OnValidatorAdded(arg0 ids.ID, arg1 ids.NodeID, arg2 uint64, arg3 bool)
- func (m *MockStateCallbackListener) OnValidatorRemoved(arg0 ids.ID, arg1 ids.NodeID)
- func (m *MockStateCallbackListener) OnValidatorStatusUpdated(arg0 ids.ID, arg1 ids.NodeID, arg2 bool)
- type MockStateCallbackListenerMockRecorder
- func (mr *MockStateCallbackListenerMockRecorder) OnValidatorAdded(arg0, arg1, arg2, arg3 any) *gomock.Call
- func (mr *MockStateCallbackListenerMockRecorder) OnValidatorRemoved(arg0, arg1 any) *gomock.Call
- func (mr *MockStateCallbackListenerMockRecorder) OnValidatorStatusUpdated(arg0, arg1, arg2 any) *gomock.Call
- type State
- type StateCallbackListener
- type StateReader
- type Validator
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 ¶
func (m *MockStateCallbackListener) EXPECT() *MockStateCallbackListenerMockRecorder
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) }