model

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrFailedToMarshalValidator

func ErrFailedToMarshalValidator(err error) sdk.Error

marshal error

func ErrFailedToMarshalValidatorList

func ErrFailedToMarshalValidatorList(err error) sdk.Error

func ErrFailedToUnmarshalValidator

func ErrFailedToUnmarshalValidator(err error) sdk.Error

unmarshal error

func ErrFailedToUnmarshalValidatorList

func ErrFailedToUnmarshalValidatorList(err error) sdk.Error

func ErrValidatorListNotFound

func ErrValidatorListNotFound() sdk.Error

func ErrValidatorNotFound

func ErrValidatorNotFound() sdk.Error

not found

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL