Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- Variables
- func AllInvariants(ck bank.Keeper, k Keeper, f auth.FeeKeeper, d distribution.Keeper, ...) sdk.Invariant
- func DelegatorSharesInvariant(k Keeper) sdk.Invariant
- func EndBlocker(ctx sdk.Context, k keeper.Keeper) (validatorUpdates []abci.ValidatorUpdate)
- func ExportGenesis(ctx sdk.Context, keeper Keeper) types.GenesisState
- func InitGenesis(ctx sdk.Context, keeper Keeper, data types.GenesisState) (res []abci.ValidatorUpdate, err error)
- func NewHandler(k keeper.Keeper) sdk.Handler
- func NonNegativePowerInvariant(k Keeper) sdk.Invariant
- func PositiveDelegationInvariant(k Keeper) sdk.Invariant
- func SupplyInvariants(ck bank.Keeper, k Keeper, f auth.FeeKeeper, d distribution.Keeper, ...) sdk.Invariant
- func ValidateGenesis(data types.GenesisState) error
- func WriteValidators(ctx sdk.Context, keeper Keeper) (vals []tmtypes.GenesisValidator)
- type BondedPool
- type Commission
- type Delegation
- type Description
- type GenesisState
- type Keeper
- type MsgBeginRedelegate
- type MsgBeginUnbonding
- type MsgCreateValidator
- func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int) MsgCreateValidator
- func NewTestMsgCreateValidatorOnBehalfOf(delAddr sdk.AccAddress, valAddr sdk.ValAddress, valPubKey crypto.PubKey, ...) MsgCreateValidator
- func NewTestMsgCreateValidatorWithCommission(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int, ...) MsgCreateValidator
- type MsgDelegate
- type MsgEditValidator
- type Params
- type Pool
- type PoolStatus
- type QueryBondsParams
- type QueryDelegatorParams
- type QueryRedelegationParams
- type QueryValidatorParams
- type Redelegation
- type UnbondingDelegation
- type Validator
Constants ¶
const ( QueryValidators = querier.QueryValidators QueryValidator = querier.QueryValidator QueryValidatorUnbondingDelegations = querier.QueryValidatorUnbondingDelegations QueryValidatorRedelegations = querier.QueryValidatorRedelegations QueryDelegation = querier.QueryDelegation QueryRedelegation = querier.QueryRedelegation QueryUnbondingDelegation = querier.QueryUnbondingDelegation QueryDelegatorDelegations = querier.QueryDelegatorDelegations QueryValidatorDelegations = querier.QueryValidatorDelegations QueryDelegatorUnbondingDelegations = querier.QueryDelegatorUnbondingDelegations QueryDelegatorRedelegations = querier.QueryDelegatorRedelegations QueryDelegatorValidators = querier.QueryDelegatorValidators QueryDelegatorValidator = querier.QueryDelegatorValidator QueryPool = querier.QueryPool QueryParameters = querier.QueryParameters )
const ( DefaultCodespace = types.DefaultCodespace CodeInvalidValidator = types.CodeInvalidValidator CodeInvalidDelegation = types.CodeInvalidDelegation CodeInvalidInput = types.CodeInvalidInput CodeValidatorJailed = types.CodeValidatorJailed CodeInternal = types.CodeInternal CodeUnknownRequest = types.CodeUnknownRequest )
Variables ¶
var ( NewKeeper = keeper.NewKeeper PrometheusMetrics = keeper.PrometheusMetrics NopMetrics = keeper.NopMetrics GetValidatorKey = keeper.GetValidatorKey GetValidatorByConsAddrKey = keeper.GetValidatorByConsAddrKey GetValidatorsByPowerIndexKey = keeper.GetValidatorsByPowerIndexKey GetDelegationKey = keeper.GetDelegationKey GetDelegationsKey = keeper.GetDelegationsKey PoolKey = keeper.PoolKey LastValidatorPowerKey = keeper.LastValidatorPowerKey LastTotalPowerKey = keeper.LastTotalPowerKey ValidatorsKey = keeper.ValidatorsKey ValidatorsByConsAddrKey = keeper.ValidatorsByConsAddrKey ValidatorsByPowerIndexKey = keeper.ValidatorsByPowerIndexKey DelegationKey = keeper.DelegationKey GetUBDKey = keeper.GetUBDKey GetUBDByValIndexKey = keeper.GetUBDByValIndexKey GetUBDsKey = keeper.GetUBDsKey GetUBDsByValIndexKey = keeper.GetUBDsByValIndexKey GetREDKey = keeper.GetREDKey GetREDByValSrcIndexKey = keeper.GetREDByValSrcIndexKey GetREDByValDstIndexKey = keeper.GetREDByValDstIndexKey GetREDsKey = keeper.GetREDsKey GetREDsFromValSrcIndexKey = keeper.GetREDsFromValSrcIndexKey GetREDsToValDstIndexKey = keeper.GetREDsToValDstIndexKey GetREDsByDelToValDstIndexKey = keeper.GetREDsByDelToValDstIndexKey TestingUpdateValidator = keeper.TestingUpdateValidator UnbondingQueueKey = keeper.UnbondingQueueKey RedelegationQueueKey = keeper.RedelegationQueueKey ValidatorQueueKey = keeper.ValidatorQueueKey DefaultParamspace = types.DefaultParamSpace KeyUnbondingTime = types.KeyUnbondingTime KeyMaxValidators = types.KeyMaxValidators BondDenom = types.StakeDenom DefaultParams = types.DefaultParams InitialBondedPool = types.InitialBondedPool NewValidator = types.NewValidator NewDescription = types.NewDescription NewCommission = types.NewCommission NewCommissionMsg = types.NewCommissionMsg NewCommissionWithTime = types.NewCommissionWithTime NewGenesisState = types.NewGenesisState DefaultGenesisState = types.DefaultGenesisState RegisterCodec = types.RegisterCodec NewMsgCreateValidator = types.NewMsgCreateValidator NewMsgCreateValidatorOnBehalfOf = types.NewMsgCreateValidatorOnBehalfOf NewMsgEditValidator = types.NewMsgEditValidator NewMsgDelegate = types.NewMsgDelegate NewMsgBeginUnbonding = types.NewMsgBeginUnbonding NewMsgBeginRedelegate = types.NewMsgBeginRedelegate NewQuerier = querier.NewQuerier NewQueryDelegatorParams = querier.NewQueryDelegatorParams NewQueryValidatorParams = querier.NewQueryValidatorParams NewQueryBondsParams = querier.NewQueryBondsParams )
var ( ErrNilValidatorAddr = types.ErrNilValidatorAddr ErrNoValidatorFound = types.ErrNoValidatorFound ErrValidatorOwnerExists = types.ErrValidatorOwnerExists ErrValidatorPubKeyExists = types.ErrValidatorPubKeyExists ErrValidatorPubKeyTypeUnsupported = types.ErrValidatorPubKeyTypeNotSupported ErrValidatorJailed = types.ErrValidatorJailed ErrBadRemoveValidator = types.ErrBadRemoveValidator ErrDescriptionLength = types.ErrDescriptionLength ErrCommissionNegative = types.ErrCommissionNegative ErrCommissionHuge = types.ErrCommissionHuge ErrNilDelegatorAddr = types.ErrNilDelegatorAddr ErrBadDenom = types.ErrBadDenom ErrBadDelegationAmount = types.ErrBadDelegationAmount ErrNoDelegation = types.ErrNoDelegation ErrBadDelegatorAddr = types.ErrBadDelegatorAddr ErrNoDelegatorForAddress = types.ErrNoDelegatorForAddress ErrDelegationValidatorEmpty = types.ErrDelegationValidatorEmpty ErrNotMature = types.ErrNotMature ErrNoUnbondingDelegation = types.ErrNoUnbondingDelegation ErrNoRedelegation = types.ErrNoRedelegation ErrBadRedelegationDst = types.ErrBadRedelegationDst ErrMissingSignature = types.ErrMissingSignature )
var ( ActionCreateValidator = tags.ActionCreateValidator ActionEditValidator = tags.ActionEditValidator ActionDelegate = tags.ActionDelegate ActionBeginUnbonding = tags.ActionBeginUnbonding ActionCompleteUnbonding = tags.ActionCompleteUnbonding ActionBeginRedelegation = tags.ActionBeginRedelegation ActionCompleteRedelegation = tags.ActionCompleteRedelegation TagAction = tags.Action TagSrcValidator = tags.SrcValidator TagDstValidator = tags.DstValidator TagDelegator = tags.Delegator TagMoniker = tags.Moniker TagIdentity = tags.Identity )
Functions ¶
func AllInvariants ¶ added in v0.11.0
func AllInvariants(ck bank.Keeper, k Keeper, f auth.FeeKeeper, d distribution.Keeper, am auth.AccountKeeper) sdk.Invariant
AllInvariants runs all invariants of the stake module. Currently: total supply, positive power
func DelegatorSharesInvariant ¶ added in v0.11.0
DelegatorSharesInvariant checks whether all the delegator shares which persist in the delegator object add up to the correct total delegator shares amount stored in each validator
func EndBlocker ¶
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, data types.GenesisState) (res []abci.ValidatorUpdate, err error)
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.
func NonNegativePowerInvariant ¶ added in v0.11.0
NonNegativePowerInvariant checks that all stored validators have >= 0 power.
func PositiveDelegationInvariant ¶ added in v0.11.0
PositiveDelegationInvariant checks that all stored delegations have > 0 shares.
func SupplyInvariants ¶ added in v0.11.0
func SupplyInvariants(ck bank.Keeper, k Keeper, f auth.FeeKeeper, d distribution.Keeper, am auth.AccountKeeper) sdk.Invariant
SupplyInvariants checks that the total supply reflects all held loose tokens, bonded tokens, and unbonding delegations nolint: unparam
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 BondedPool ¶ added in v0.10.0
type BondedPool = types.BondedPool
type Commission ¶
type Commission = types.Commission
type Delegation ¶
type Delegation = types.Delegation
type Description ¶
type Description = types.Description
type GenesisState ¶
type GenesisState = types.GenesisState
type MsgBeginRedelegate ¶
type MsgBeginRedelegate = types.MsgBeginRedelegate
type MsgBeginUnbonding ¶
type MsgBeginUnbonding = types.MsgBeginUnbonding
type MsgCreateValidator ¶
type MsgCreateValidator = types.MsgCreateValidator
func NewTestMsgCreateValidator ¶
func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int) MsgCreateValidator
func NewTestMsgCreateValidatorOnBehalfOf ¶
func NewTestMsgCreateValidatorOnBehalfOf(delAddr sdk.AccAddress, valAddr sdk.ValAddress, valPubKey crypto.PubKey, amt sdk.Int) MsgCreateValidator
func NewTestMsgCreateValidatorWithCommission ¶
func NewTestMsgCreateValidatorWithCommission(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int, commissionRate sdk.Dec) 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 PoolStatus ¶ added in v0.10.0
type PoolStatus = types.PoolStatus
type QueryBondsParams ¶
type QueryBondsParams = querier.QueryBondsParams
type QueryDelegatorParams ¶
type QueryDelegatorParams = querier.QueryDelegatorParams
type QueryRedelegationParams ¶ added in v0.14.0
type QueryRedelegationParams = querier.QueryRedelegationParams
type QueryValidatorParams ¶
type QueryValidatorParams = querier.QueryValidatorParams
type Redelegation ¶
type Redelegation = types.Redelegation
type UnbondingDelegation ¶
type UnbondingDelegation = types.UnbondingDelegation