validatorsmap

package
v1.3.11 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*ValidatorsMap)

Option defines EventSyncer configuration option.

func WithInitialState

func WithInitialState(state map[string]*validator.Validator) Option

WithInitialState sets initial state

type ValidatorsMap

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

ValidatorsMap manages a collection of running validators

func New

func New(ctx context.Context, opts ...Option) *ValidatorsMap

func (*ValidatorsMap) CreateValidator

func (vm *ValidatorsMap) CreateValidator(pubKey string, v *validator.Validator)

CreateValidator creates a new validator instance TODO: pass spectypes.ValidatorPK instead of string

func (*ValidatorsMap) ForEach

func (vm *ValidatorsMap) ForEach(iterator validatorIterator) bool

ForEach loops over validators

func (*ValidatorsMap) GetAll

func (vm *ValidatorsMap) GetAll() []*validator.Validator

GetAll returns all validators.

func (*ValidatorsMap) GetValidator

func (vm *ValidatorsMap) GetValidator(pubKey string) (*validator.Validator, bool)

GetValidator returns a validator TODO: pass spectypes.ValidatorPK instead of string

func (*ValidatorsMap) RemoveValidator

func (vm *ValidatorsMap) RemoveValidator(pubKey string) *validator.Validator

RemoveValidator removes a validator instance from the map TODO: pass spectypes.ValidatorPK instead of string

func (*ValidatorsMap) Size

func (vm *ValidatorsMap) Size() int

Size returns the number of validators in the map

Jump to

Keyboard shortcuts

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