Versions in this module Expand all Collapse all v1 v1.0.1 Apr 21, 2023 Changes in this version + var ErrInvalidBLSValidatorFormat = errors.New("invalid validator format, expected [Validator Address]:[BLS Public Key]") + var ErrInvalidTypeAssert = errors.New("invalid type assert") + var ErrInvalidValidatorType = errors.New("invalid validator type") + var ErrInvalidValidators = errors.New("container is not ") + var ErrMismatchValidatorType = errors.New("mismatch between validator and validators") + var ErrMismatchValidatorsType = errors.New("mismatch between two validators") + var ErrValidatorAlreadyExists = errors.New("validator already exists in validators") + var ErrValidatorNotFound = errors.New("validator not found in validators") + type BLSValidator struct + Address types.Address + BLSPublicKey BLSValidatorPublicKey + func NewBLSValidator(addr types.Address, blsPubkey []byte) *BLSValidator + func ParseBLSValidator(validator string) (*BLSValidator, error) + func (v *BLSValidator) Addr() types.Address + func (v *BLSValidator) Bytes() []byte + func (v *BLSValidator) Copy() Validator + func (v *BLSValidator) Equal(vr Validator) bool + func (v *BLSValidator) MarshalRLPWith(arena *fastrlp.Arena) *fastrlp.Value + func (v *BLSValidator) SetFromBytes(input []byte) error + func (v *BLSValidator) String() string + func (v *BLSValidator) Type() ValidatorType + func (v *BLSValidator) UnmarshalRLPFrom(p *fastrlp.Parser, val *fastrlp.Value) error + type BLSValidatorPublicKey []byte + func (k *BLSValidatorPublicKey) UnmarshalText(input []byte) error + func (k BLSValidatorPublicKey) MarshalText() ([]byte, error) + func (k BLSValidatorPublicKey) String() string + type ECDSAValidator struct + Address types.Address + func NewECDSAValidator(addr types.Address) *ECDSAValidator + func ParseECDSAValidator(validator string) *ECDSAValidator + func (v *ECDSAValidator) Addr() types.Address + func (v *ECDSAValidator) Bytes() []byte + func (v *ECDSAValidator) Copy() Validator + func (v *ECDSAValidator) Equal(vr Validator) bool + func (v *ECDSAValidator) MarshalRLPWith(arena *fastrlp.Arena) *fastrlp.Value + func (v *ECDSAValidator) SetFromBytes(input []byte) error + func (v *ECDSAValidator) String() string + func (v *ECDSAValidator) Type() ValidatorType + func (v *ECDSAValidator) UnmarshalRLPFrom(p *fastrlp.Parser, val *fastrlp.Value) error + type Set struct + ValidatorType ValidatorType + Validators []Validator + func (s *Set) Add(val Validator) error + func (s *Set) At(index uint64) Validator + func (s *Set) Copy() Validators + func (s *Set) Del(val Validator) error + func (s *Set) Equal(ss Validators) bool + func (s *Set) Includes(addr types.Address) bool + func (s *Set) Index(addr types.Address) int64 + func (s *Set) Len() int + func (s *Set) MarshalJSON() ([]byte, error) + func (s *Set) MarshalRLPWith(arena *fastrlp.Arena) *fastrlp.Value + func (s *Set) Merge(ss Validators) error + func (s *Set) Type() ValidatorType + func (s *Set) UnmarshalJSON(data []byte) error + func (s *Set) UnmarshalRLPFrom(p *fastrlp.Parser, val *fastrlp.Value) error + type Validator interface + Addr func() types.Address + Bytes func() []byte + Copy func() Validator + Equal func(Validator) bool + MarshalRLPWith func(*fastrlp.Arena) *fastrlp.Value + SetFromBytes func([]byte) error + String func() string + Type func() ValidatorType + UnmarshalRLPFrom func(*fastrlp.Parser, *fastrlp.Value) error + func NewValidatorFromType(t ValidatorType) (Validator, error) + func ParseValidator(validatorType ValidatorType, validator string) (Validator, error) + type ValidatorType string + const BLSValidatorType + const ECDSAValidatorType + func ParseValidatorType(validatorType string) (ValidatorType, error) + type Validators interface + Add func(Validator) error + At func(uint64) Validator + Copy func() Validators + Del func(Validator) error + Equal func(Validators) bool + Includes func(types.Address) bool + Index func(types.Address) int64 + Len func() int + MarshalRLPWith func(*fastrlp.Arena) *fastrlp.Value + Merge func(Validators) error + Type func() ValidatorType + UnmarshalRLPFrom func(*fastrlp.Parser, *fastrlp.Value) error + func NewBLSValidatorSet(blsValidators ...*BLSValidator) Validators + func NewECDSAValidatorSet(ecdsaValidators ...*ECDSAValidator) Validators + func NewValidatorSetFromType(t ValidatorType) Validators + func ParseValidators(validatorType ValidatorType, rawValidators []string) (Validators, error)