Documentation ¶
Index ¶
- func ErrFailedToMarshalValidator(err error) sdk.Error
- func ErrFailedToMarshalValidatorList(err error) sdk.Error
- func ErrFailedToUnmarshalValidator(err error) sdk.Error
- func ErrFailedToUnmarshalValidatorList(err error) sdk.Error
- func ErrValidatorListNotFound() sdk.Error
- func ErrValidatorNotFound() sdk.Error
- func GetValidatorKey(accKey types.AccountKey) []byte
- func GetValidatorListKey() []byte
- type Validator
- type ValidatorList
- type ValidatorStorage
- func (vs ValidatorStorage) DeleteValidator(ctx sdk.Context, username types.AccountKey) sdk.Error
- func (vs ValidatorStorage) DoesValidatorExist(ctx sdk.Context, accKey types.AccountKey) bool
- func (vs ValidatorStorage) GetValidator(ctx sdk.Context, accKey types.AccountKey) (*Validator, sdk.Error)
- func (vs ValidatorStorage) GetValidatorList(ctx sdk.Context) (*ValidatorList, sdk.Error)
- func (vs ValidatorStorage) InitGenesis(ctx sdk.Context) error
- func (vs ValidatorStorage) SetValidator(ctx sdk.Context, accKey types.AccountKey, validator *Validator) sdk.Error
- func (vs ValidatorStorage) SetValidatorList(ctx sdk.Context, lst *ValidatorList) sdk.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrFailedToMarshalValidator ¶
marshal error
func ErrFailedToUnmarshalValidator ¶
unmarshal error
func GetValidatorKey ¶
func GetValidatorKey(accKey types.AccountKey) []byte
func GetValidatorListKey ¶
func GetValidatorListKey() []byte
Types ¶
type Validator ¶
type Validator struct { ABCIValidator abci.Validator Username types.AccountKey `json:"username"` Deposit types.Coin `json:"deposit"` AbsentCommit int64 `json:"absent_commit"` ByzantineCommit int64 `json:"byzantine_commit"` ProducedBlocks int64 `json:"produced_blocks"` Link string `json:"link"` }
Validator is basic structure records all validator information
type ValidatorList ¶
type ValidatorList struct { OncallValidators []types.AccountKey `json:"oncall_validators"` AllValidators []types.AccountKey `json:"all_validators"` PreBlockValidators []types.AccountKey `json:"pre_block_validators"` LowestPower types.Coin `json:"lowest_power"` LowestValidator types.AccountKey `json:"lowest_validator"` }
Validator list
type ValidatorStorage ¶
type ValidatorStorage struct {
// contains filtered or unexported fields
}
func NewValidatorStorage ¶
func NewValidatorStorage(key sdk.StoreKey) ValidatorStorage
func (ValidatorStorage) DeleteValidator ¶
func (vs ValidatorStorage) DeleteValidator(ctx sdk.Context, username types.AccountKey) sdk.Error
func (ValidatorStorage) DoesValidatorExist ¶
func (vs ValidatorStorage) DoesValidatorExist(ctx sdk.Context, accKey types.AccountKey) bool
func (ValidatorStorage) GetValidator ¶
func (vs ValidatorStorage) GetValidator(ctx sdk.Context, accKey types.AccountKey) (*Validator, sdk.Error)
func (ValidatorStorage) GetValidatorList ¶
func (vs ValidatorStorage) GetValidatorList(ctx sdk.Context) (*ValidatorList, sdk.Error)
func (ValidatorStorage) InitGenesis ¶
func (vs ValidatorStorage) InitGenesis(ctx sdk.Context) error
func (ValidatorStorage) SetValidator ¶
func (vs ValidatorStorage) SetValidator(ctx sdk.Context, accKey types.AccountKey, validator *Validator) sdk.Error
func (ValidatorStorage) SetValidatorList ¶
func (vs ValidatorStorage) SetValidatorList(ctx sdk.Context, lst *ValidatorList) sdk.Error
Click to show internal directories.
Click to hide internal directories.