Versions in this module Expand all Collapse all v0 v0.1.1 Nov 25, 2021 Changes in this version + const AttributeKeyCompletionTime + const AttributeKeyDelegator + const AttributeKeyValidator + const AttributeValueCategory + const BondedPoolName + const DefaultHistoricalEntries + const DefaultMaxEntries + const DefaultMaxValidators + const DefaultUnbondingTime + const DoNotModifyDesc + const EventTypeCompleteUnbonding + const EventTypeCreateValidator + const EventTypeDelegate + const EventTypeEditValidator + const EventTypeUnbond + const MaxDetailsLength + const MaxIdentityLength + const MaxMonikerLength + const MaxSecurityContactLength + const MaxWebsiteLength + const ModuleName + const NotBondedPoolName + const QuerierRoute + const QueryDelegation + const QueryDelegatorDelegations + const QueryDelegatorUnbondingDelegations + const QueryDelegatorValidator + const QueryDelegatorValidators + const QueryHistoricalInfo + const QueryParameters + const QueryPool + const QueryUnbondingDelegation + const QueryValidator + const QueryValidatorDelegations + const QueryValidatorUnbondingDelegations + const QueryValidators + const RouterKey + const StoreKey + const TStoreKey + var DefaultStake = sdk.NewIntFromString("50000000000000") + var DelegationKey = []byte + var ErrBadDelegationAddr = sdkerrors.Register(ModuleName, 21, "invalid address for (address, validator) tuple") + var ErrBadDelegationAmount = sdkerrors.Register(ModuleName, 22, "invalid delegation amount") + var ErrBadDelegatorAddr = sdkerrors.Register(ModuleName, 24, "delegator does not exist with address") + var ErrBadDenom = sdkerrors.Register(ModuleName, 20, "invalid coin denomination") + var ErrBadRemoveValidator = sdkerrors.Register(ModuleName, 8, "failed to remove validator") + var ErrBadSharesAmount = sdkerrors.Register(ModuleName, 29, "invalid shares amount") + var ErrBadSharesPercent = sdkerrors.Register(ModuleName, 30, "Invalid shares percent") + var ErrBadValidatorAddr = sdkerrors.Register(ModuleName, 2, "validator address is invalid") + var ErrBothShareMsgsGiven = sdkerrors.Register(ModuleName, 42, "both shares amount and shares percent provided") + var ErrDelegationValidatorEmpty = sdkerrors.Register(ModuleName, 27, "cannot delegate to an empty validator") + var ErrDelegatorShareExRateInvalid = sdkerrors.Register(ModuleName, 41, "cannot delegate to validators with invalid (zero) ex-rate") + var ErrEmptyDelegatorAddr = sdkerrors.Register(ModuleName, 19, "empty delegator address") + var ErrEmptyValidatorAddr = sdkerrors.Register(ModuleName, 1, "empty validator address") + var ErrInsufficientShares = sdkerrors.Register(ModuleName, 26, "insufficient delegation shares") + var ErrInvalidGenesis = sdkerrors.Register(ModuleName, 46, "invalid genesis state") + var ErrInvalidHistoricalInfo = sdkerrors.Register(ModuleName, 44, "invalid historical info") + var ErrMaxUnbondingDelegationEntries = sdkerrors.Register(ModuleName, 33, ...) + var ErrMinSelfDelegationDecreased = sdkerrors.Register(ModuleName, 18, "minimum self delegation cannot be decrease") + var ErrMinSelfDelegationInvalid = sdkerrors.Register(ModuleName, 17, "minimum self delegation must be a positive integer") + var ErrNeitherShareMsgsGiven = sdkerrors.Register(ModuleName, 43, "neither shares amount nor shares percent provided") + var ErrNoDelegation = sdkerrors.Register(ModuleName, 23, "no delegation for (address, validator) tuple") + var ErrNoDelegatorForAddress = sdkerrors.Register(ModuleName, 25, "delegator does not contain delegation") + var ErrNoHistoricalInfo = sdkerrors.Register(ModuleName, 45, "no historical info found") + var ErrNoUnbondingDelegation = sdkerrors.Register(ModuleName, 32, "no unbonding delegation found") + var ErrNoValidatorFound = sdkerrors.Register(ModuleName, 3, "validator does not exist") + var ErrNotEnoughDelegationShares = sdkerrors.Register(ModuleName, 28, "not enough delegation shares") + var ErrNotMature = sdkerrors.Register(ModuleName, 31, "entry not mature") + var ErrSelfDelegationBelowMinimum = sdkerrors.Register(ModuleName, 16, ...) + var ErrValidatorJailed = sdkerrors.Register(ModuleName, 7, "validator for this address is currently jailed") + var ErrValidatorOwnerExists = sdkerrors.Register(ModuleName, 4, ...) + var ErrValidatorPubKeyExists = sdkerrors.Register(ModuleName, 5, ...) + var ErrValidatorPubKeyTypeNotSupported = sdkerrors.Register(ModuleName, 6, "validator pubkey type is not supported") + var HistoricalInfoKey = []byte + var KeyBondDenom = []byte("BondDenom") + var KeyHistoricalEntries = []byte("HistoricalEntries") + var KeyMaxEntries = []byte("KeyMaxEntries") + var KeyMaxValidators = []byte("MaxValidators") + var KeyUnbondingTime = []byte("UnbondingTime") + var LastTotalPowerKey = []byte + var LastValidatorPowerKey = []byte + var ModuleCdc *codec.Codec + var TicketKey = []byte + var UnbondingDelegationByValIndexKey = []byte + var UnbondingDelegationKey = []byte + var UnbondingQueueKey = []byte + var ValidatorQueueKey = []byte + var ValidatorsByConsAddrKey = []byte + var ValidatorsByPowerIndexKey = []byte + var ValidatorsByTicketKey = []byte + var ValidatorsKey = []byte + func AddressFromLastValidatorPowerKey(key []byte) []byte + func GetDelegationKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte + func GetDelegationsKey(delAddr sdk.AccAddress) []byte + func GetHistoricalInfoKey(height int64) []byte + func GetLastValidatorPowerKey(operator sdk.ValAddress) []byte + func GetTicketBytes(ticket uint64) (ticketBz []byte) + func GetTicketFromBytes(bz []byte) (ticket uint64) + func GetUBDByValIndexKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte + func GetUBDKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte + func GetUBDKeyFromValIndexKey(indexKey []byte) []byte + func GetUBDsByValIndexKey(valAddr sdk.ValAddress) []byte + func GetUBDsKey(delAddr sdk.AccAddress) []byte + func GetUnbondingDelegationTimeKey(timestamp time.Time) []byte + func GetValidatorByConsAddrKey(addr sdk.ConsAddress) []byte + func GetValidatorKey(operatorAddr sdk.ValAddress) []byte + func GetValidatorQueueTimeKey(timestamp time.Time) []byte + func GetValidatorsByPowerIndexKey(validator Validator) []byte + func GetValidatorsByTicketKey(validator Validator) []byte + func MustMarshalDelegation(cdc *codec.Codec, delegation Delegation) []byte + func MustMarshalHistoricalInfo(cdc *codec.Codec, hi HistoricalInfo) []byte + func MustMarshalUBD(cdc *codec.Codec, ubd UnbondingDelegation) []byte + func MustMarshalValidator(cdc *codec.Codec, validator Validator) []byte + func ParseValidatorPowerRankKey(key []byte) (operAddr []byte) + func ParseValidatorTicketKey(key []byte) (ticket uint64, operAddr []byte) + func RegisterCodec(cdc *codec.Codec) + func ValidateBasic(hi HistoricalInfo) error + type AccountKeeper interface + GetAccount func(ctx sdk.Context, addr sdk.AccAddress) authexported.Account + IterateAccounts func(ctx sdk.Context, process func(authexported.Account) (stop bool)) + type DVPair struct + DelegatorAddress sdk.AccAddress + ValidatorAddress sdk.ValAddress + type Delegation struct + DelegatorAddress sdk.AccAddress + Shares sdk.Dec + ValidatorAddress sdk.ValAddress + func MustUnmarshalDelegation(cdc *codec.Codec, value []byte) Delegation + func NewDelegation(delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, shares sdk.Dec) Delegation + func UnmarshalDelegation(cdc *codec.Codec, value []byte) (delegation Delegation, err error) + func (d Delegation) Equal(d2 Delegation) bool + func (d Delegation) GetDelegatorAddr() sdk.AccAddress + func (d Delegation) GetShares() sdk.Dec + func (d Delegation) GetValidatorAddr() sdk.ValAddress + func (d Delegation) String() string + type DelegationResponse struct + Balance sdk.Coin + func NewDelegationResp(delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, shares sdk.Dec, ...) DelegationResponse + func (d *DelegationResponse) UnmarshalJSON(bz []byte) error + func (d DelegationResponse) MarshalJSON() ([]byte, error) + func (d DelegationResponse) String() string + type DelegationResponses []DelegationResponse + func (d DelegationResponses) String() (out string) + type DelegationSet interface + GetValidatorSet func() ValidatorSet + IterateDelegations func(ctx sdk.Context, delegator sdk.AccAddress, ...) + type Delegations []Delegation + func (d Delegations) String() (out string) + type Description struct + Details string + Identity string + Moniker string + SecurityContact string + Website string + func NewDescription(moniker, identity, website, securityContact, details string) Description + func (d Description) EnsureLength() (Description, error) + func (d Description) UpdateDescription(d2 Description) (Description, error) + type DistributionKeeper interface + GetFeePoolCommunityCoins func(ctx sdk.Context) sdk.DecCoins + GetValidatorOutstandingRewardsCoins func(ctx sdk.Context, val sdk.ValAddress) sdk.DecCoins + type GenesisState struct + Delegations Delegations + Exported bool + LastTotalPower sdk.Int + LastValidatorPowers []LastValidatorPower + Params Params + StartingTicket uint64 + UnbondingDelegations []UnbondingDelegation + Validators Validators + func DefaultGenesisState() GenesisState + func NewGenesisState(params Params, validators []Validator, delegations []Delegation, ...) GenesisState + type HistoricalInfo struct + Header abci.Header + ValSet []Validator + func MustUnmarshalHistoricalInfo(cdc *codec.Codec, value []byte) HistoricalInfo + func NewHistoricalInfo(header abci.Header, valSet []Validator) HistoricalInfo + func UnmarshalHistoricalInfo(cdc *codec.Codec, value []byte) (hi HistoricalInfo, err error) + type LastValidatorPower struct + Address sdk.ValAddress + Power int64 + type MsgCreateValidator struct + DelegatorAddress sdk.AccAddress + Description Description + PubKey crypto.PubKey + ValidatorAddress sdk.ValAddress + Value sdk.Coin + func NewMsgCreateValidator(valAddr sdk.ValAddress, pubKey crypto.PubKey, selfDelegation sdk.Coin, ...) MsgCreateValidator + func (msg *MsgCreateValidator) UnmarshalJSON(bz []byte) error + func (msg MsgCreateValidator) GetSignBytes() []byte + func (msg MsgCreateValidator) GetSigners() []sdk.AccAddress + func (msg MsgCreateValidator) MarshalJSON() ([]byte, error) + func (msg MsgCreateValidator) MarshalYAML() (interface{}, error) + func (msg MsgCreateValidator) Route() string + func (msg MsgCreateValidator) Type() string + func (msg MsgCreateValidator) ValidateBasic() error + type MsgDelegate struct + DelegatorAddress sdk.AccAddress + ValidatorAddress sdk.ValAddress + func NewMsgDelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress) MsgDelegate + func (msg MsgDelegate) GetSignBytes() []byte + func (msg MsgDelegate) GetSigners() []sdk.AccAddress + func (msg MsgDelegate) Route() string + func (msg MsgDelegate) Type() string + func (msg MsgDelegate) ValidateBasic() error + type MsgEditValidator struct + Description Description + ValidatorAddress sdk.ValAddress + func NewMsgEditValidator(valAddr sdk.ValAddress, description Description) MsgEditValidator + func (msg MsgEditValidator) GetSignBytes() []byte + func (msg MsgEditValidator) GetSigners() []sdk.AccAddress + func (msg MsgEditValidator) Route() string + func (msg MsgEditValidator) Type() string + func (msg MsgEditValidator) ValidateBasic() error + type MsgUndelegate struct + DelegatorAddress sdk.AccAddress + ValidatorAddress sdk.ValAddress + func NewMsgUndelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress) MsgUndelegate + func (msg MsgUndelegate) GetSignBytes() []byte + func (msg MsgUndelegate) GetSigners() []sdk.AccAddress + func (msg MsgUndelegate) Route() string + func (msg MsgUndelegate) Type() string + func (msg MsgUndelegate) ValidateBasic() error + type MultiStakingHooks []StakingHooks + func NewMultiStakingHooks(hooks ...StakingHooks) MultiStakingHooks + func (h MultiStakingHooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) + func (h MultiStakingHooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) + func (h MultiStakingHooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) + func (h MultiStakingHooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) + func (h MultiStakingHooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) + func (h MultiStakingHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) + func (h MultiStakingHooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) + func (h MultiStakingHooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) + func (h MultiStakingHooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) + func (h MultiStakingHooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) + type Params struct + BondDenom string + HistoricalEntries uint16 + MaxEntries uint16 + MaxValidators uint16 + UnbondingTime time.Duration + func DefaultParams() Params + func MustUnmarshalParams(cdc *codec.Codec, value []byte) Params + func NewParams(unbondingTime time.Duration, ...) Params + func UnmarshalParams(cdc *codec.Codec, value []byte) (params Params, err error) + func (p *Params) ParamSetPairs() params.ParamSetPairs + func (p Params) Equal(p2 Params) bool + func (p Params) String() string + func (p Params) Validate() error + type Pool struct + BondedTokens sdk.Int + NotBondedTokens sdk.Int + func NewPool(notBonded, bonded sdk.Int) Pool + func (p Pool) String() string + type QueryBondsParams struct + DelegatorAddr sdk.AccAddress + ValidatorAddr sdk.ValAddress + func NewQueryBondsParams(delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) QueryBondsParams + type QueryDelegatorParams struct + DelegatorAddr sdk.AccAddress + func NewQueryDelegatorParams(delegatorAddr sdk.AccAddress) QueryDelegatorParams + type QueryHistoricalInfoParams struct + Height int64 + func NewQueryHistoricalInfoParams(height int64) QueryHistoricalInfoParams + type QueryValidatorParams struct + ValidatorAddr sdk.ValAddress + func NewQueryValidatorParams(validatorAddr sdk.ValAddress) QueryValidatorParams + type QueryValidatorsParams struct + Limit int + Page int + Status string + func NewQueryValidatorsParams(page, limit int, status string) QueryValidatorsParams + type StakingHooks interface + AfterDelegationModified func(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) + AfterValidatorBeginUnbonding func(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) + AfterValidatorBonded func(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) + AfterValidatorCreated func(ctx sdk.Context, valAddr sdk.ValAddress) + AfterValidatorRemoved func(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) + BeforeDelegationCreated func(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) + BeforeDelegationRemoved func(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) + BeforeDelegationSharesModified func(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) + BeforeValidatorModified func(ctx sdk.Context, valAddr sdk.ValAddress) + BeforeValidatorSlashed func(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) + type SupplyKeeper interface + BurnCoins func(ctx sdk.Context, name string, amt sdk.Coins) error + DelegateCoinsFromAccountToModule func(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, ...) error + GetModuleAccount func(ctx sdk.Context, moduleName string) supplyexported.ModuleAccountI + GetModuleAddress func(name string) sdk.AccAddress + GetSupply func(ctx sdk.Context) supplyexported.SupplyI + SendCoinsFromModuleToModule func(ctx sdk.Context, senderPool, recipientPool string, amt sdk.Coins) error + SetModuleAccount func(sdk.Context, supplyexported.ModuleAccountI) + UndelegateCoinsFromModuleToAccount func(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, ...) error + type UnbondingDelegation struct + DelegatorAddress sdk.AccAddress + Entries []UnbondingDelegationEntry + ValidatorAddress sdk.ValAddress + func MustUnmarshalUBD(cdc *codec.Codec, value []byte) UnbondingDelegation + func NewUnbondingDelegation(delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, ...) UnbondingDelegation + func UnmarshalUBD(cdc *codec.Codec, value []byte) (ubd UnbondingDelegation, err error) + func (d *UnbondingDelegation) AddEntry(creationHeight int64, minTime time.Time, balance sdk.Int) + func (d *UnbondingDelegation) RemoveEntry(i int64) + func (d UnbondingDelegation) Equal(d2 UnbondingDelegation) bool + func (d UnbondingDelegation) String() string + type UnbondingDelegationEntry struct + Balance sdk.Int + CompletionTime time.Time + CreationHeight int64 + InitialBalance sdk.Int + func NewUnbondingDelegationEntry(creationHeight int64, completionTime time.Time, balance sdk.Int) UnbondingDelegationEntry + func (e UnbondingDelegationEntry) IsMature(currentTime time.Time) bool + type UnbondingDelegations []UnbondingDelegation + func (ubds UnbondingDelegations) String() (out string) + type Validator struct + ConsPubKey crypto.PubKey + DelegatorShares sdk.Dec + Description Description + Jailed bool + MinSelfDelegation sdk.Int + OperatorAddress sdk.ValAddress + Status sdk.BondStatus + Ticket uint64 + Tokens sdk.Int + UnbondingCompletionTime time.Time + UnbondingHeight int64 + func MustUnmarshalValidator(cdc *codec.Codec, value []byte) Validator + func NewValidator(operator sdk.ValAddress, pubKey crypto.PubKey, description Description) Validator + func UnmarshalValidator(cdc *codec.Codec, value []byte) (validator Validator, err error) + func (v *Validator) UnmarshalJSON(data []byte) error + func (v Validator) ABCIValidatorUpdate() abci.ValidatorUpdate + func (v Validator) ABCIValidatorUpdateZero() abci.ValidatorUpdate + func (v Validator) AddTokensFromDel(amount sdk.Int) (Validator, sdk.Dec) + func (v Validator) BondedTokens() sdk.Int + func (v Validator) ConsAddress() sdk.ConsAddress + func (v Validator) ConsensusPower() int64 + func (v Validator) GetBondedTokens() sdk.Int + func (v Validator) GetConsAddr() sdk.ConsAddress + func (v Validator) GetConsPubKey() crypto.PubKey + func (v Validator) GetConsensusPower() int64 + func (v Validator) GetDelegatorShares() sdk.Dec + func (v Validator) GetMinSelfDelegation() sdk.Int + func (v Validator) GetMoniker() string + func (v Validator) GetOperator() sdk.ValAddress + func (v Validator) GetStatus() sdk.BondStatus + func (v Validator) GetTicket() uint64 + func (v Validator) GetTokens() sdk.Int + func (v Validator) InvalidExRate() bool + func (v Validator) IsBonded() bool + func (v Validator) IsJailed() bool + func (v Validator) IsUnbonded() bool + func (v Validator) IsUnbonding() bool + func (v Validator) MarshalJSON() ([]byte, error) + func (v Validator) MarshalYAML() (interface{}, error) + func (v Validator) PotentialConsensusPower() int64 + func (v Validator) RemoveDelShares(delShares sdk.Dec) (Validator, sdk.Int) + func (v Validator) RemoveTokens(tokens sdk.Int) Validator + func (v Validator) SharesFromTokens(amt sdk.Int) (sdk.Dec, error) + func (v Validator) SharesFromTokensTruncated(amt sdk.Int) (sdk.Dec, error) + func (v Validator) String() string + func (v Validator) TestEquivalent(v2 Validator) bool + func (v Validator) TokensFromShares(shares sdk.Dec) sdk.Dec + func (v Validator) TokensFromSharesRoundUp(shares sdk.Dec) sdk.Dec + func (v Validator) TokensFromSharesTruncated(shares sdk.Dec) sdk.Dec + func (v Validator) UpdateStatus(newStatus sdk.BondStatus) Validator + type ValidatorSet interface + Delegation func(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingexported.DelegationI + IterateBondedValidatorsByPower func(sdk.Context, ...) + IterateLastValidators func(sdk.Context, ...) + IterateValidators func(sdk.Context, ...) + Jail func(sdk.Context, sdk.ConsAddress) + MaxValidators func(sdk.Context) uint16 + Slash func(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) + StakingTokenSupply func(sdk.Context) sdk.Int + TotalBondedTokens func(sdk.Context) sdk.Int + Unjail func(sdk.Context, sdk.ConsAddress) + Validator func(sdk.Context, sdk.ValAddress) stakingexported.ValidatorI + ValidatorByConsAddr func(sdk.Context, sdk.ConsAddress) stakingexported.ValidatorI + type Validators []Validator + func (v Validators) Len() int + func (v Validators) Less(i, j int) bool + func (v Validators) Sort() + func (v Validators) String() (out string) + func (v Validators) Swap(i, j int) + func (v Validators) ToSDKValidators() (validators []exported.ValidatorI)