model

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2019 License: Apache-2.0 Imports: 7 Imported by: 3

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 ABCIPubKeyIR added in v0.2.0

type ABCIPubKeyIR struct {
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}

ABCIPubKeyIR - type changed during upgrade.

type ABCIValidatorIR added in v0.2.0

type ABCIValidatorIR struct {
	Address []byte       `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	PubKey  ABCIPubKeyIR `protobuf:"bytes,2,opt,name=pub_key,json=pubKey" json:"pub_key"`
	Power   int64        `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"`
}

ABCIValidatorIR - type changed during upgrade.

type Validator

type Validator struct {
	ABCIValidator   abci.Validator
	PubKey          crypto.PubKey    `json:"pubkey"`
	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

func (Validator) ToIR added in v0.2.0

func (v Validator) ToIR() ValidatorIR

ToIR -

type ValidatorIR added in v0.2.0

type ValidatorIR struct {
	ABCIValidator   ABCIValidatorIR
	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"`
}

ValidatorIR - ABCIValidator internally changed.

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"`
}

ValidatorList -

type ValidatorListRow added in v0.2.0

type ValidatorListRow struct {
	List ValidatorList `json:"list"`
}

ValidatorListRow - pk: none

type ValidatorRow added in v0.2.0

type ValidatorRow struct {
	Username types.AccountKey `json:"username"`
	// XXX(yumin): type changed.
	Validator Validator `json:"validator"`
}

ValidatorRow - pk: (Username)

func (ValidatorRow) ToIR added in v0.2.0

func (v ValidatorRow) ToIR() ValidatorRowIR

ToIR -

type ValidatorRowIR added in v0.2.0

type ValidatorRowIR struct {
	Username types.AccountKey `json:"username"`
	// XXX(yumin): type changed.
	Validator ValidatorIR `json:"validator"`
}

ValidatorRowIR - pk: (Username)

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) Export added in v0.2.0

func (vs ValidatorStorage) Export(ctx sdk.Context) *ValidatorTables

Export state of validators.

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) Import added in v0.2.0

func (vs ValidatorStorage) Import(ctx sdk.Context, tb *ValidatorTablesIR)

Import from tablesIR.

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

type ValidatorTables added in v0.2.0

type ValidatorTables struct {
	Validators    []ValidatorRow   `json:"validators"`
	ValidatorList ValidatorListRow `json:"validator_list"`
}

ValidatorTables state of validators

func (ValidatorTables) ToIR added in v0.2.0

ToIR -

type ValidatorTablesIR added in v0.2.0

type ValidatorTablesIR struct {
	Validators    []ValidatorRowIR `json:"validators"`
	ValidatorList ValidatorListRow `json:"validator_list"`
}

ValidatorTablesIR - Validators changed.

Jump to

Keyboard shortcuts

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