cosmos-sdk: Index | Files

package v0_38

import ""




Package Files

migrate.go types.go


const (
    ModuleName = "staking"

type Description Uses

type Description struct {
    Moniker         string `json:"moniker" yaml:"moniker"`
    Identity        string `json:"identity" yaml:"identity"`
    Website         string `json:"website" yaml:"website"`
    SecurityContact string `json:"security_contact" yaml:"security_contact"`
    Details         string `json:"details" yaml:"details"`

func NewDescription Uses

func NewDescription(moniker, identity, website, securityContact, details string) Description

NewDescription creates a new Description object

type GenesisState Uses

type GenesisState struct {
    Params               v034staking.Params                `json:"params"`
    LastTotalPower       sdk.Int                           `json:"last_total_power"`
    LastValidatorPowers  []v034staking.LastValidatorPower  `json:"last_validator_powers"`
    Validators           Validators                        `json:"validators"`
    Delegations          v034staking.Delegations           `json:"delegations"`
    UnbondingDelegations []v034staking.UnbondingDelegation `json:"unbonding_delegations"`
    Redelegations        []v034staking.Redelegation        `json:"redelegations"`
    Exported             bool                              `json:"exported"`

func Migrate Uses

func Migrate(oldGenState v036staking.GenesisState) GenesisState

Migrate accepts exported genesis state from v0.36 or v0.37 and migrates it to v0.38 genesis state. All entries are identical except for validator descriptions which now include a security contact.

func NewGenesisState Uses

func NewGenesisState(
    params v034staking.Params, lastTotalPower sdk.Int, lastValPowers []v034staking.LastValidatorPower,
    validators Validators, delegations v034staking.Delegations,
    ubds []v034staking.UnbondingDelegation, reds []v034staking.Redelegation, exported bool,
) GenesisState

NewGenesisState creates a new GenesisState object

type Validator Uses

type Validator struct {
    OperatorAddress         sdk.ValAddress         `json:"operator_address" yaml:"operator_address"`
    ConsPubKey              crypto.PubKey          `json:"consensus_pubkey" yaml:"consensus_pubkey"`
    Jailed                  bool                   `json:"jailed" yaml:"jailed"`
    Status                  sdk.BondStatus         `json:"status" yaml:"status"`
    Tokens                  sdk.Int                `json:"tokens" yaml:"tokens"`
    DelegatorShares         sdk.Dec                `json:"delegator_shares" yaml:"delegator_shares"`
    Description             Description            `json:"description" yaml:"description"`
    UnbondingHeight         int64                  `json:"unbonding_height" yaml:"unbonding_height"`
    UnbondingCompletionTime time.Time              `json:"unbonding_time" yaml:"unbonding_time"`
    Commission              v036staking.Commission `json:"commission" yaml:"commission"`
    MinSelfDelegation       sdk.Int                `json:"min_self_delegation" yaml:"min_self_delegation"`

func (Validator) MarshalJSON Uses

func (v Validator) MarshalJSON() ([]byte, error)

MarshalJSON marshals the validator to JSON using Bech32

func (*Validator) UnmarshalJSON Uses

func (v *Validator) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the validator from JSON using Bech32

type Validators Uses

type Validators []Validator

Package v0_38 imports 6 packages (graph) and is imported by 1 packages. Updated 2020-07-18. Refresh now. Tools for package owners.