staking

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultParamspace                  = keeper.DefaultParamspace
	ModuleName                         = types.ModuleName
	StoreKey                           = types.StoreKey
	TStoreKey                          = types.TStoreKey
	QuerierRoute                       = types.QuerierRoute
	RouterKey                          = types.RouterKey
	DefaultUnbondingTime               = types.DefaultUnbondingTime
	DefaultMaxValidators               = types.DefaultMaxValidators
	DefaultMaxValidatorsExtendingLimit = types.DefaultMaxValidatorsExtendingLimit
	DefaultMaxValidatorsExtendingSpeed = types.DefaultMaxValidatorsExtendingSpeed
	MaxValidatorsExtendingInterval     = types.MaxValidatorsExtendingInterval
	DefaultMaxEntries                  = types.DefaultMaxEntries
	NotBondedPoolName                  = types.NotBondedPoolName
	BondedPoolName                     = types.BondedPoolName
	QueryValidators                    = types.QueryValidators
	QueryValidator                     = types.QueryValidator
	QueryDelegatorDelegations          = types.QueryDelegatorDelegations
	QueryDelegatorUnbondingDelegations = types.QueryDelegatorUnbondingDelegations
	QueryRedelegations                 = types.QueryRedelegations
	QueryValidatorDelegations          = types.QueryValidatorDelegations
	QueryValidatorRedelegations        = types.QueryValidatorRedelegations
	QueryValidatorUnbondingDelegations = types.QueryValidatorUnbondingDelegations
	QueryDelegation                    = types.QueryDelegation
	QueryUnbondingDelegation           = types.QueryUnbondingDelegation
	QueryDelegatorValidators           = types.QueryDelegatorValidators
	QueryDelegatorValidator            = types.QueryDelegatorValidator
	QueryPool                          = types.QueryPool
	QueryParameters                    = types.QueryParameters
	MaxMonikerLength                   = types.MaxMonikerLength
	MaxIdentityLength                  = types.MaxIdentityLength
	MaxWebsiteLength                   = types.MaxWebsiteLength
	MaxDetailsLength                   = types.MaxDetailsLength
	DoNotModifyDesc                    = types.DoNotModifyDesc
)

Variables

View Source
var (
	DefaultMaxLever = types.DefaultMaxLever

	// functions aliases
	RegisterInvariants           = keeper.RegisterInvariants
	AllInvariants                = keeper.AllInvariants
	ModuleAccountInvariants      = keeper.ModuleAccountInvariants
	NonNegativePowerInvariant    = keeper.NonNegativePowerInvariant
	PositiveDelegationInvariant  = keeper.PositiveDelegationInvariant
	DelegatorSharesInvariant     = keeper.DelegatorSharesInvariant
	NewKeeper                    = keeper.NewKeeper
	ParamKeyTable                = keeper.ParamKeyTable
	NewQuerier                   = keeper.NewQuerier
	RegisterCodec                = types.RegisterCodec
	NewCommissionRates           = types.NewCommissionRates
	NewCommission                = types.NewCommission
	NewCommissionWithTime        = types.NewCommissionWithTime
	NewDelegation                = types.NewDelegation
	MustMarshalDelegation        = types.MustMarshalDelegation
	MustUnmarshalDelegation      = types.MustUnmarshalDelegation
	UnmarshalDelegation          = types.UnmarshalDelegation
	NewUnbondingDelegation       = types.NewUnbondingDelegation
	NewUnbondingDelegationEntry  = types.NewUnbondingDelegationEntry
	MustMarshalUBD               = types.MustMarshalUBD
	MustUnmarshalUBD             = types.MustUnmarshalUBD
	UnmarshalUBD                 = types.UnmarshalUBD
	NewRedelegation              = types.NewRedelegation
	NewRedelegationEntry         = types.NewRedelegationEntry
	MustMarshalRED               = types.MustMarshalRED
	MustUnmarshalRED             = types.MustUnmarshalRED
	UnmarshalRED                 = types.UnmarshalRED
	NewDelegationResp            = types.NewDelegationResp
	NewRedelegationResponse      = types.NewRedelegationResponse
	NewRedelegationEntryResponse = types.NewRedelegationEntryResponse

	ErrEmptyValidatorAddr              = types.ErrEmptyValidatorAddr
	ErrBadValidatorAddr                = types.ErrBadValidatorAddr
	ErrNoValidatorFound                = types.ErrNoValidatorFound
	ErrValidatorOwnerExists            = types.ErrValidatorOwnerExists
	ErrValidatorPubKeyExists           = types.ErrValidatorPubKeyExists
	ErrValidatorPubKeyTypeNotSupported = types.ErrValidatorPubKeyTypeNotSupported
	ErrValidatorJailed                 = types.ErrValidatorJailed
	ErrBadRemoveValidator              = types.ErrBadRemoveValidator
	ErrCommissionNegative              = types.ErrCommissionNegative
	ErrCommissionHuge                  = types.ErrCommissionHuge
	ErrCommissionGTMaxRate             = types.ErrCommissionGTMaxRate
	ErrCommissionUpdateTime            = types.ErrCommissionUpdateTime
	ErrCommissionChangeRateNegative    = types.ErrCommissionChangeRateNegative
	ErrCommissionChangeRateGTMaxRate   = types.ErrCommissionChangeRateGTMaxRate
	ErrCommissionGTMaxChangeRate       = types.ErrCommissionGTMaxChangeRate
	ErrSelfDelegationBelowMinimum      = types.ErrSelfDelegationBelowMinimum
	ErrMinSelfDelegationInvalid        = types.ErrMinSelfDelegationInvalid
	ErrMinSelfDelegationDecreased      = types.ErrMinSelfDelegationDecreased
	ErrEmptyDelegatorAddr              = types.ErrEmptyDelegatorAddr
	ErrBadDenom                        = types.ErrBadDenom
	ErrBadDelegationAddr               = types.ErrBadDelegationAddr
	ErrBadDelegationAmount             = types.ErrBadDelegationAmount
	ErrNoDelegation                    = types.ErrNoDelegation
	ErrBadDelegatorAddr                = types.ErrBadDelegatorAddr
	ErrNoDelegatorForAddress           = types.ErrNoDelegatorForAddress
	ErrInsufficientShares              = types.ErrInsufficientShares
	ErrDelegationValidatorEmpty        = types.ErrDelegationValidatorEmpty
	ErrNotEnoughDelegationShares       = types.ErrNotEnoughDelegationShares
	ErrBadSharesAmount                 = types.ErrBadSharesAmount
	ErrBadSharesPercent                = types.ErrBadSharesPercent
	ErrNotMature                       = types.ErrNotMature
	ErrNoUnbondingDelegation           = types.ErrNoUnbondingDelegation
	ErrMaxUnbondingDelegationEntries   = types.ErrMaxUnbondingDelegationEntries
	ErrBadRedelegationAddr             = types.ErrBadRedelegationAddr
	ErrNoRedelegation                  = types.ErrNoRedelegation
	ErrSelfRedelegation                = types.ErrSelfRedelegation
	ErrTinyRedelegationAmount          = types.ErrTinyRedelegationAmount
	ErrBadRedelegationDst              = types.ErrBadRedelegationDst
	ErrTransitiveRedelegation          = types.ErrTransitiveRedelegation
	ErrMaxRedelegationEntries          = types.ErrMaxRedelegationEntries
	ErrDelegatorShareExRateInvalid     = types.ErrDelegatorShareExRateInvalid
	ErrBothShareMsgsGiven              = types.ErrBothShareMsgsGiven
	ErrNeitherShareMsgsGiven           = types.ErrNeitherShareMsgsGiven
	ErrInvalidHistoricalInfo           = types.ErrInvalidHistoricalInfo
	ErrNoHistoricalInfo                = types.ErrNoHistoricalInfo
	ErrDelegatorShareExceedMaxLever    = types.ErrDelegatorShareExceedMaxLever
	NewGenesisState                    = types.NewGenesisState
	DefaultGenesisState                = types.DefaultGenesisState
	NewMultiStakingHooks               = types.NewMultiStakingHooks
	GetValidatorKey                    = types.GetValidatorKey
	GetValidatorByConsAddrKey          = types.GetValidatorByConsAddrKey
	AddressFromLastValidatorPowerKey   = types.AddressFromLastValidatorPowerKey
	GetValidatorsByPowerIndexKey       = types.GetValidatorsByPowerIndexKey
	GetLastValidatorPowerKey           = types.GetLastValidatorPowerKey
	ParseValidatorPowerRankKey         = types.ParseValidatorPowerRankKey
	GetValidatorQueueTimeKey           = types.GetValidatorQueueTimeKey
	GetDelegationKey                   = types.GetDelegationKey
	GetDelegationsKey                  = types.GetDelegationsKey
	GetUBDKey                          = types.GetUBDKey
	GetUBDByValIndexKey                = types.GetUBDByValIndexKey
	GetUBDKeyFromValIndexKey           = types.GetUBDKeyFromValIndexKey
	GetUBDsKey                         = types.GetUBDsKey
	GetUBDsByValIndexKey               = types.GetUBDsByValIndexKey
	GetUnbondingDelegationTimeKey      = types.GetUnbondingDelegationTimeKey
	GetREDKey                          = types.GetREDKey
	GetREDByValSrcIndexKey             = types.GetREDByValSrcIndexKey
	GetREDByValDstIndexKey             = types.GetREDByValDstIndexKey
	GetREDKeyFromValSrcIndexKey        = types.GetREDKeyFromValSrcIndexKey
	GetREDKeyFromValDstIndexKey        = types.GetREDKeyFromValDstIndexKey
	GetRedelegationTimeKey             = types.GetRedelegationTimeKey
	GetREDsKey                         = types.GetREDsKey
	GetREDsFromValSrcIndexKey          = types.GetREDsFromValSrcIndexKey
	GetREDsToValDstIndexKey            = types.GetREDsToValDstIndexKey
	GetREDsByDelToValDstIndexKey       = types.GetREDsByDelToValDstIndexKey
	NewMsgCreateValidator              = types.NewMsgCreateValidator
	NewMsgEditValidator                = types.NewMsgEditValidator
	NewMsgDelegate                     = types.NewMsgDelegate
	NewMsgBeginRedelegate              = types.NewMsgBeginRedelegate
	NewMsgUndelegate                   = types.NewMsgUndelegate
	NewParams                          = types.NewParams
	DefaultParams                      = types.DefaultParams
	MustUnmarshalParams                = types.MustUnmarshalParams
	UnmarshalParams                    = types.UnmarshalParams
	NewPool                            = types.NewPool
	NewQueryDelegatorParams            = types.NewQueryDelegatorParams
	NewQueryValidatorParams            = types.NewQueryValidatorParams
	NewQueryBondsParams                = types.NewQueryBondsParams
	NewQueryRedelegationParams         = types.NewQueryRedelegationParams
	NewQueryValidatorsParams           = types.NewQueryValidatorsParams
	NewValidator                       = types.NewValidator
	MustMarshalValidator               = types.MustMarshalValidator
	MustUnmarshalValidator             = types.MustUnmarshalValidator
	UnmarshalValidator                 = types.UnmarshalValidator
	NewDescription                     = types.NewDescription

	// variable aliases
	ModuleCdc                        = types.ModuleCdc
	LastValidatorPowerKey            = types.LastValidatorPowerKey
	LastTotalPowerKey                = types.LastTotalPowerKey
	ValidatorsKey                    = types.ValidatorsKey
	ValidatorsByConsAddrKey          = types.ValidatorsByConsAddrKey
	ValidatorsByPowerIndexKey        = types.ValidatorsByPowerIndexKey
	DelegationKey                    = types.DelegationKey
	UnbondingDelegationKey           = types.UnbondingDelegationKey
	UnbondingDelegationByValIndexKey = types.UnbondingDelegationByValIndexKey
	RedelegationKey                  = types.RedelegationKey
	RedelegationByValSrcIndexKey     = types.RedelegationByValSrcIndexKey
	RedelegationByValDstIndexKey     = types.RedelegationByValDstIndexKey
	UnbondingQueueKey                = types.UnbondingQueueKey
	RedelegationQueueKey             = types.RedelegationQueueKey
	ValidatorQueueKey                = types.ValidatorQueueKey
	KeyUnbondingTime                 = types.KeyUnbondingTime
	KeyMaxValidators                 = types.KeyMaxValidators
	KeyMaxEntries                    = types.KeyMaxEntries
	KeyBondDenom                     = types.KeyBondDenom
	KeyMaxValidatorsExtendingLimit   = types.KeyMaxValidatorsExtendingLimit
	KeyMaxValidatorsExtendingSpeed   = types.KeyMaxValidatorsExtendingSpeed
	KeyNextExtendingTime             = types.KeyNextExtendingTime
	KeyMaxLever                      = types.KeyMaxLever

	EventTypeCompleteUnbonding    = types.EventTypeCompleteUnbonding
	EventTypeCompleteRedelegation = types.EventTypeCompleteRedelegation
	EventTypeCreateValidator      = types.EventTypeCreateValidator
	EventTypeEditValidator        = types.EventTypeEditValidator
	EventTypeDelegate             = types.EventTypeDelegate
	EventTypeUnbond               = types.EventTypeUnbond
	EventTypeRedelegate           = types.EventTypeRedelegate

	AttributeKeyValidator         = types.AttributeKeyValidator
	AttributeKeyCommissionRate    = types.AttributeKeyCommissionRate
	AttributeKeyMinSelfDelegation = types.AttributeKeyMinSelfDelegation
	AttributeKeySrcValidator      = types.AttributeKeySrcValidator
	AttributeKeyDstValidator      = types.AttributeKeyDstValidator
	AttributeKeyDelegator         = types.AttributeKeyDelegator
	AttributeKeyCompletionTime    = types.AttributeKeyCompletionTime
	AttributeValueCategory        = types.AttributeValueCategory
)

Functions

func EndBlocker

func EndBlocker(ctx sdk.Context, k keeper.Keeper) []abci.ValidatorUpdate

Called every block, update validator set

func ExportGenesis

func ExportGenesis(ctx sdk.Context, keeper Keeper) types.GenesisState

ExportGenesis returns a GenesisState for a given context and keeper. The GenesisState will contain the pool, params, validators, and bonds found in the keeper.

func InitGenesis

func InitGenesis(ctx sdk.Context, keeper Keeper, accountKeeper types.AccountKeeper,
	supplyKeeper types.SupplyKeeper, data types.GenesisState) (res []abci.ValidatorUpdate)

InitGenesis sets the pool and parameters for the provided keeper. For each validator in data, it sets that validator in the keeper along with manually setting the indexes. In addition, it also sets any delegations found in data. Finally, it updates the bonded validators. Returns final validator set after applying all declaration and delegations

func NewHandler

func NewHandler(k keeper.Keeper) sdk.Handler

func ValidateGenesis

func ValidateGenesis(data types.GenesisState) error

ValidateGenesis validates the provided staking genesis state to ensure the expected invariants holds. (i.e. params in correct bounds, no duplicate validators)

func WriteValidators

func WriteValidators(ctx sdk.Context, keeper Keeper) (vals []tmtypes.GenesisValidator)

WriteValidators returns a slice of bonded genesis validators.

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

app module

func NewAppModule

func NewAppModule(keeper Keeper, distrKeeper types.DistributionKeeper, accKeeper types.AccountKeeper,
	supplyKeeper types.SupplyKeeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock

func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)

BeginBlock returns the begin blocker for the staking module.

func (AppModule) EndBlock

module end-block

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage

module export genesis

func (AppModule) GenerateGenesisState

func (am AppModule) GenerateGenesisState(simState *module.SimulationState)

for simulation

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate

module init-genesis

func (AppModule) Name

func (AppModule) Name() string

module name

func (AppModule) NewHandler

func (am AppModule) NewHandler() sdk.Handler

module handler

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

module querier

func (AppModule) ProposalContents

func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

module querier route name

func (AppModule) RandomizedParams

func (am AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)

register invariants

func (AppModule) Route

func (AppModule) Route() string

module message route name

func (AppModule) WeightedOperations

func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation

type AppModuleBasic

type AppModuleBasic struct{}

app module basics object

func (AppModuleBasic) BuildCreateValidatorMsg

func (AppModuleBasic) BuildCreateValidatorMsg(cliCtx context.CLIContext,
	txBldr authtypes.TxBuilder) (authtypes.TxBuilder, sdk.Msg, error)

BuildCreateValidatorMsg - used for gen-tx

func (AppModuleBasic) CreateValidatorMsgHelpers

func (AppModuleBasic) CreateValidatorMsgHelpers(ipDefault string) (
	fs *flag.FlagSet, nodeIDFlag, pubkeyFlag, amountFlag, defaultsDesc string)

CreateValidatorMsgHelpers - used for gen-tx

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis() json.RawMessage

default genesis state

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command

GetQueryCmd returns the root query command for the staking module.

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command

get the root tx command of this module

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

module name

func (AppModuleBasic) PrepareFlagsForTxCreateValidator

func (AppModuleBasic) PrepareFlagsForTxCreateValidator(config *cfg.Config, nodeID,
	chainID string, valPubKey crypto.PubKey)

PrepareFlagsForTxCreateValidator - used for gen-tx

func (AppModuleBasic) RegisterCodec

func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)

register module codec

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)

register rest routes

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error

module validate genesis

type Commission

type Commission = types.Commission

type CommissionRates

type CommissionRates = types.CommissionRates

type DVPair

type DVPair = types.DVPair

type DVVTriplet

type DVVTriplet = types.DVVTriplet

type Delegation

type Delegation = types.Delegation

type DelegationI

type DelegationI = exported.DelegationI

type DelegationResponse

type DelegationResponse = types.DelegationResponse

type DelegationResponses

type DelegationResponses = types.DelegationResponses

type Delegations

type Delegations = types.Delegations

type Description

type Description = types.Description

type GenesisState

type GenesisState = types.GenesisState

type Keeper

type Keeper = keeper.Keeper

type LastValidatorPower

type LastValidatorPower = types.LastValidatorPower

type MsgBeginRedelegate

type MsgBeginRedelegate = types.MsgBeginRedelegate

type MsgCreateValidator

type MsgCreateValidator = types.MsgCreateValidator

func NewTestMsgCreateValidator

func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int) MsgCreateValidator

type MsgDelegate

type MsgDelegate = types.MsgDelegate

func NewTestMsgDelegate

func NewTestMsgDelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt sdk.Int) MsgDelegate

type MsgEditValidator

type MsgEditValidator = types.MsgEditValidator

type MsgUndelegate

type MsgUndelegate = types.MsgUndelegate

type MultiStakingHooks

type MultiStakingHooks = types.MultiStakingHooks

type Params

type Params = types.Params

type Pool

type Pool = types.Pool

type QueryBondsParams

type QueryBondsParams = types.QueryBondsParams

type QueryDelegatorParams

type QueryDelegatorParams = types.QueryDelegatorParams

type QueryRedelegationParams

type QueryRedelegationParams = types.QueryRedelegationParams

type QueryValidatorParams

type QueryValidatorParams = types.QueryValidatorParams

type QueryValidatorsParams

type QueryValidatorsParams = types.QueryValidatorsParams

type Redelegation

type Redelegation = types.Redelegation

type RedelegationEntry

type RedelegationEntry = types.RedelegationEntry

type RedelegationEntryResponse

type RedelegationEntryResponse = types.RedelegationEntryResponse

type RedelegationResponse

type RedelegationResponse = types.RedelegationResponse

type RedelegationResponses

type RedelegationResponses = types.RedelegationResponses

type Redelegations

type Redelegations = types.Redelegations

type UnbondingDelegation

type UnbondingDelegation = types.UnbondingDelegation

type UnbondingDelegationEntry

type UnbondingDelegationEntry = types.UnbondingDelegationEntry

type UnbondingDelegations

type UnbondingDelegations = types.UnbondingDelegations

type Validator

type Validator = types.Validator

type ValidatorI

type ValidatorI = exported.ValidatorI

type Validators

type Validators = types.Validators

Directories

Path Synopsis
client
cli
nolint
nolint

Jump to

Keyboard shortcuts

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