Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

validators source pure

Constants 1

const ValidatorAddedEvent, ValidatorRemovedEvent

1const (
2	ValidatorAddedEvent   = "ValidatorAdded"   // emitted when a validator was added to the set
3	ValidatorRemovedEvent = "ValidatorRemoved" // emitted when a validator was removed from the set
4)
source

Variables 1

var ErrValidatorExists, ErrValidatorMissing

1var (
2	// ErrValidatorExists is returned when the validator is already in the set
3	ErrValidatorExists = errors.New("validator already exists")
4
5	// ErrValidatorMissing is returned when the validator is not in the set
6	ErrValidatorMissing = errors.New("validator doesn't exist")
7)
source

Types 2

type Validator

struct
1type Validator struct {
2	Address     address // bech32 address
3	PubKey      string  // bech32 representation of the public key
4	VotingPower uint64
5}
source

Validator represents a single chain validator

type ValsetProtocol

interface
 1type ValsetProtocol interface {
 2	// AddValidator adds a new validator to the validator set.
 3	// If the validator is already present, the method should error out
 4	//
 5	// TODO: This API is not ideal -- the address should be derived from
 6	// the public key, and not be passed in as such, but currently Gno
 7	// does not support crypto address derivation
 8	AddValidator(address_XXX address, pubKey string, power uint64) (Validator, error)
 9
10	// RemoveValidator removes the given validator from the set.
11	// If the validator is not present in the set, the method should error out
12	RemoveValidator(address_XXX address) (Validator, error)
13
14	// IsValidator returns a flag indicating if the given
15	// bech32 address is part of the validator set
16	IsValidator(address_XXX address) bool
17
18	// GetValidator returns the validator using the given address
19	GetValidator(address_XXX address) (Validator, error)
20
21	// GetValidators returns the currently active validator set
22	GetValidators() []Validator
23}
source

ValsetProtocol defines the validator set protocol (PoA / PoS / PoC / ?)

Imports 1

  • errors stdlib

Source Files 2