validators source pure
1
1
2
type Validator
structValidator 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}ValsetProtocol defines the validator set protocol (PoA / PoS / PoC / ?)
1
- errors stdlib