Documentation ¶
Overview ¶
Described types for PoA module.
Describing errors and codes.
Parameters store for PoA module.
Types for querier.
Index ¶
- Constants
- Variables
- func ErrMaxValidatorsReached(max uint16) sdk.Error
- func ErrMinValidatorsReached(min uint16) sdk.Error
- func ErrNotEnoungValidators(actual uint16, min uint16) sdk.Error
- func ErrValidatorDoesntExists(address string) sdk.Error
- func ErrValidatorExists(address string) sdk.Error
- func ErrWrongEthereumAddress(address string) sdk.Error
- type GenesisState
- type Params
- type QueryValidator
- type Validator
- type Validators
- type ValidatorsConfirmations
Constants ¶
const ( ModuleName = "poa" RouterKey = ModuleName DefaultCodespace sdk.CodespaceType = ModuleName DefaultParamspace = ModuleName )
const ( CodeValidatorExists sdk.CodeType = 101 CodeValidatorDoesntExist sdk.CodeType = 102 CodeMaxValidatorsReached sdk.CodeType = 103 CodeMinValidatorsReached sdk.CodeType = 104 CodeWrongEthereumAddress sdk.CodeType = 201 CodeNotEnoughValidators sdk.CodeType = 301 )
const ( DefaultMaxValidators uint16 = 11 DefaultMinValidators uint16 = 3 )
Default parameters.
Variables ¶
var ( ValidatorsCountKey = []byte("validators_count") // Count key in DB to count validators. ValidatorsListKey = []byte("validators") // Key in DB to store validators. )
var ( KeyMaxValidators = []byte("MaxValidators") KeyMinValidators = []byte("MinValidators") )
Key to store min and max validators parameters.
Functions ¶
func ErrMaxValidatorsReached ¶
Validators maximum limit reached (on genesis init / add validator request)
func ErrMinValidatorsReached ¶
Validators minimum limit reached (on genesis init / add validator request)
func ErrNotEnoungValidators ¶
Not enough validators to initialize genesis
func ErrValidatorDoesntExists ¶
Msg.Validator not found
func ErrValidatorExists ¶
Msg.Validator already exists
func ErrWrongEthereumAddress ¶
Validator's ethereum address is invalid (on validator add / replace)
Types ¶
type GenesisState ¶
type GenesisState struct { Parameters Params `json:"parameters"` PoAValidators Validators `json:"validators"` }
Genesis state parameters contains genesis data.
type Params ¶
type Params struct { MaxValidators uint16 `json:"max_validators"` MinValidators uint16 `json:"min_validators"` }
Describing parameters for PoA module, like: min and max validators amount.
func DefaultParams ¶
func DefaultParams() Params
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
type QueryValidator ¶
type QueryValidator struct {
Address types.AccAddress
}
Request for querier to export validators by address.
type Validator ¶
type Validator struct { Address sdk.AccAddress `json:"address" example:"wallet1a7280dyzp487r7wghr99f6r3h2h2z4gk4d740m"` EthAddress string `json:"eth_address" example:"0x29D7d1dd5B6f9C864d9db560D72a247c178aE86B"` }
Described validator.
func NewValidator ¶
func NewValidator(address sdk.AccAddress, ethAddress string) Validator
Creating new validator instance.
type ValidatorsConfirmations ¶
type ValidatorsConfirmations struct { Validators Validators `json:"validators"` // Registered validators list Confirmations uint16 `json:"confirmations" example:"3"` // Minimum number of confirmations needed to approve Call }
Response from querier with confirmations and validators list.
func (ValidatorsConfirmations) String ¶
func (q ValidatorsConfirmations) String() string