Documentation ¶
Index ¶
- Constants
- Variables
- func GetUBDKeyFromValIndexKey(indexKey []byte) []byte
- func MustUnmarshalValidator(cdc *codec.Codec, value []byte) types.Validator
- func NewQuerier(k StakingKeeper) sdk.Querier
- func UnmarshalValidator(cdc *codec.Codec, value []byte) (v types.Validator, err error)
- type StakingKeeper
- func (k StakingKeeper) AddValidatorTokensAndShares(ctx sdk.Context, validator types.Validator, tokensToAdd sdk.Int) (valOut types.Validator, addedShares sdk.Dec)
- func (k StakingKeeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress)
- func (k StakingKeeper) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.AccAddress, valAddr sdk.AccAddress)
- func (k StakingKeeper) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.AccAddress, valAddr sdk.AccAddress)
- func (k StakingKeeper) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.AccAddress)
- func (k StakingKeeper) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.AccAddress, valAddr sdk.AccAddress)
- func (k StakingKeeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abcitypes.ValidatorUpdate)
- func (k StakingKeeper) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress)
- func (k StakingKeeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress)
- func (k StakingKeeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress)
- func (k StakingKeeper) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.AccAddress)
- func (k StakingKeeper) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.AccAddress, fraction sdk.Dec)
- func (k StakingKeeper) BlockValidatorUpdates(ctx sdk.Context) []abcitypes.ValidatorUpdate
- func (k StakingKeeper) BondDenom(ctx sdk.Context) (bondDenom string)
- func (k StakingKeeper) BondedRatio(ctx sdk.Context) sdk.Dec
- func (k StakingKeeper) BondedTokensToMoudleAccount(ctx sdk.Context, tokens sdk.Int, moduleName string) error
- func (k StakingKeeper) CompleteRedelegationWithAmount(ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.AccAddress) (sdk.Coins, error)
- func (k StakingKeeper) CompleteUnbondingWithAmount(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress) (sdk.Coins, error)
- func (k StakingKeeper) Delegate(ctx sdk.Context, delAddr sdk.AccAddress, bondAmt sdk.Int, ...) (newShares sdk.Dec, err error)
- func (k StakingKeeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk.AccAddress) exported.DelegationI
- func (k StakingKeeper) DeleteHistoricalInfo(ctx sdk.Context, height int64)
- func (k StakingKeeper) DeleteLastValidatorPower(ctx sdk.Context, operator sdk.AccAddress)
- func (k StakingKeeper) DeleteValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)
- func (k StakingKeeper) DeleteValidatorQueue(ctx sdk.Context, val types.Validator)
- func (k StakingKeeper) DeleteValidatorQueueTimeSlice(ctx sdk.Context, timestamp time.Time)
- func (k StakingKeeper) DequeueAllMatureRedelegationQueue(ctx sdk.Context, currTime time.Time) (matureRedelegations []types.DVVTriplet)
- func (k StakingKeeper) DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []types.DVPair)
- func (k StakingKeeper) GetAllDelegations(ctx sdk.Context) (delegations []types.Delegation)
- func (k StakingKeeper) GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []types.Delegation
- func (k StakingKeeper) GetAllRedelegations(ctx sdk.Context, delegator sdk.AccAddress, ...) []types.Redelegation
- func (k StakingKeeper) GetAllValidators(ctx sdk.Context) (validators []types.Validator)
- func (k StakingKeeper) GetBondedPool(ctx sdk.Context) (bondedPool exported.ModuleAccountI)
- func (k StakingKeeper) GetBondedValidatorsByPower(ctx sdk.Context) []types.Validator
- func (k StakingKeeper) GetDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress) (delegation types.Delegation, found bool)
- func (k StakingKeeper) GetDelegatorValidator(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.AccAddress) (validator types.Validator, err error)
- func (k StakingKeeper) GetDelegatorValidators(ctx sdk.Context, delegatorAddr sdk.AccAddress, maxRetrieve uint32) ([]types.Validator, error)
- func (k StakingKeeper) GetHistoricalInfo(ctx sdk.Context, height int64) (types.HistoricalInfo, bool)
- func (k StakingKeeper) GetLastTotalPower(ctx sdk.Context) sdk.Int
- func (k StakingKeeper) GetLastValidatorPower(ctx sdk.Context, operator sdk.AccAddress) (power int64)
- func (k StakingKeeper) GetLastValidators(ctx sdk.Context) (validators []types.Validator)
- func (k StakingKeeper) GetNotBondedPool(ctx sdk.Context) (notBondedPool exported.ModuleAccountI)
- func (k StakingKeeper) GetParams(ctx sdk.Context) types.Params
- func (k StakingKeeper) GetRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.AccAddress) (red types.Redelegation, found bool)
- func (k StakingKeeper) GetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvvTriplets []types.DVVTriplet)
- func (k StakingKeeper) GetRedelegationsFromSrcValidator(ctx sdk.Context, valAddr sdk.AccAddress) (reds []types.Redelegation)
- func (k StakingKeeper) GetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvPairs []types.DVPair)
- func (k StakingKeeper) GetUnbondingDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress) (ubd types.UnbondingDelegation, found bool)
- func (k StakingKeeper) GetUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (unbondingDelegations []types.UnbondingDelegation)
- func (k StakingKeeper) GetUnbondingDelegationsFromValidator(ctx sdk.Context, valAddr sdk.AccAddress) (ubds []types.UnbondingDelegation)
- func (k StakingKeeper) GetValidator(ctx sdk.Context, addr sdk.AccAddress) (validator types.Validator, found bool)
- func (k StakingKeeper) GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.AccAddress) (validator types.Validator, found bool)
- func (k StakingKeeper) GetValidatorDelegations(ctx sdk.Context, valAddr sdk.AccAddress) (delegations []types.Delegation)
- func (k StakingKeeper) GetValidatorQueueTimeSlice(ctx sdk.Context, timestamp time.Time) []sdk.AccAddress
- func (k StakingKeeper) HasMaxRedelegationEntries(ctx sdk.Context, delegatorAddr sdk.AccAddress, ...) bool
- func (k StakingKeeper) HasMaxUnbondingDelegationEntries(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.AccAddress) bool
- func (k StakingKeeper) HasReceivingRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valDstAddr sdk.AccAddress) bool
- func (k StakingKeeper) HistoricalEntries(ctx sdk.Context) (HisEntries uint32)
- func (k StakingKeeper) InsertRedelegationQueue(ctx sdk.Context, red types.Redelegation, completionTime time.Time)
- func (k StakingKeeper) InsertUBDQueue(ctx sdk.Context, ubd types.UnbondingDelegation, completionTime time.Time)
- func (k StakingKeeper) InsertValidatorQueue(ctx sdk.Context, val types.Validator)
- func (k StakingKeeper) IterateAllDelegations(ctx sdk.Context, cb func(delegation types.Delegation) (stop bool))
- func (k StakingKeeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, validator types2.Validator) (stop bool))
- func (k StakingKeeper) IterateValidators(ctx sdk.Context, fn func(index int64, validator types.Validator) (stop bool))
- func (k StakingKeeper) Jail(ctx sdk.Context, consAddr sdk.AccAddress)
- func (k StakingKeeper) LastValidatorsIterator(ctx sdk.Context) (iterator sdk.Iterator)
- func (k StakingKeeper) Logger(ctx sdk.Context) log.Logger
- func (k StakingKeeper) MaxEntries(ctx sdk.Context) (maxEntries uint32)
- func (k StakingKeeper) MaxValidators(ctx sdk.Context) (maxValidators uint32)
- func (k StakingKeeper) NotBondedTokensToModuleAccount(ctx sdk.Context, tokens sdk.Int, moduleName string) error
- func (k StakingKeeper) Redelegate(ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.AccAddress, ...) (completionTime time.Time, err error)
- func (k StakingKeeper) RedelegationQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (k StakingKeeper) RemoveDelegation(ctx sdk.Context, delegation types.Delegation)
- func (k StakingKeeper) RemoveRedelegation(ctx sdk.Context, red types.Redelegation)
- func (k StakingKeeper) RemoveUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation)
- func (k StakingKeeper) RemoveValidator(ctx sdk.Context, address sdk.AccAddress)
- func (k StakingKeeper) RemoveValidatorTokens(ctx sdk.Context, validator types.Validator, tokensToRemove sdk.Int) types.Validator
- func (k StakingKeeper) RemoveValidatorTokensAndShares(ctx sdk.Context, validator types.Validator, sharesToRemove sdk.Dec) (valOut types.Validator, removedTokens sdk.Int)
- func (k StakingKeeper) SetDelegation(ctx sdk.Context, delegation types.Delegation)
- func (k StakingKeeper) SetHistoricalInfo(ctx sdk.Context, height int64, hi types.HistoricalInfo)
- func (k *StakingKeeper) SetHooks(sh types.StakingHooks) *StakingKeeper
- func (k StakingKeeper) SetLastTotalPower(ctx sdk.Context, power sdk.Int)
- func (k StakingKeeper) SetLastValidatorPower(ctx sdk.Context, operator sdk.AccAddress, power int64)
- func (k StakingKeeper) SetNewValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)
- func (k StakingKeeper) SetParams(ctx sdk.Context, params types.Params)
- func (k StakingKeeper) SetRedelegation(ctx sdk.Context, red types.Redelegation)
- func (k StakingKeeper) SetRedelegationEntry(ctx sdk.Context, delegatorAddr sdk.AccAddress, ...) types.Redelegation
- func (k StakingKeeper) SetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DVVTriplet)
- func (k StakingKeeper) SetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DVPair)
- func (k StakingKeeper) SetUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation)
- func (k StakingKeeper) SetUnbondingDelegationEntry(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.AccAddress, ...) types.UnbondingDelegation
- func (k StakingKeeper) SetValidator(ctx sdk.Context, validator types.Validator) error
- func (k StakingKeeper) SetValidatorByConsAddr(ctx sdk.Context, validator types.Validator)
- func (k StakingKeeper) SetValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)
- func (k StakingKeeper) SetValidatorQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []sdk.AccAddress)
- func (k StakingKeeper) Slash(ctx sdk.Context, consAddr sdk.AccAddress, infractionHeight int64, power int64, ...)
- func (k StakingKeeper) SlashRedelegation(ctx sdk.Context, srcValidator types.Validator, redelegation types.Redelegation, ...) (totalSlashAmount sdk.Int)
- func (k StakingKeeper) SlashUnbondingDelegation(ctx sdk.Context, unbondingDelegation types.UnbondingDelegation, ...) (totalSlashAmount sdk.Int)
- func (k StakingKeeper) StakingTokenSupply(ctx sdk.Context) sdk.Int
- func (k StakingKeeper) TotalBondedTokens(ctx sdk.Context) sdk.Int
- func (k StakingKeeper) TrackHistoricalInfo(ctx sdk.Context)
- func (k StakingKeeper) UBDQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (k StakingKeeper) Unbond(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress, ...) (amount sdk.Int, err error)
- func (k StakingKeeper) UnbondAllMatureValidatorQueue(ctx sdk.Context)
- func (k StakingKeeper) UnbondingTime(ctx sdk.Context) (unbondingTime time.Duration)
- func (k StakingKeeper) Undelegate(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress, ...) (time.Time, error)
- func (k StakingKeeper) Unjail(ctx sdk.Context, consAddr sdk.AccAddress)
- func (k StakingKeeper) UpdateValidatorCommission(ctx sdk.Context, validator types.Validator, newRate sdk.Dec) (types.Commission, error)
- func (k StakingKeeper) ValidateUnbondAmount(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress, amt sdk.Int) (shares sdk.Dec, err error)
- func (k StakingKeeper) Validator(ctx sdk.Context, address sdk.AccAddress) exported.ValidatorI
- func (k StakingKeeper) ValidatorQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (k StakingKeeper) ValidatorsPowerStoreIterator(ctx sdk.Context) sdk.Iterator
Constants ¶
const (
RouteKey = "staking"
)
Variables ¶
var ModuleCdc *codec.Codec
Functions ¶
func GetUBDKeyFromValIndexKey ¶
rearranges the ValIndexKey to get the UBDKey
func MustUnmarshalValidator ¶
unmarshal a redelegation from a store value
func NewQuerier ¶
func NewQuerier(k StakingKeeper) sdk.Querier
Types ¶
type StakingKeeper ¶
type StakingKeeper struct { AccountKeeper account.AccountKeeper SupplyKeeper supply.Keeper // contains filtered or unexported fields }
func NewStakingKeeper ¶
func (StakingKeeper) AddValidatorTokensAndShares ¶
func (StakingKeeper) AfterDelegationModified ¶
func (k StakingKeeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress)
AfterDelegationModified - call hook if registered
func (StakingKeeper) AfterValidatorBeginUnbonding ¶
func (k StakingKeeper) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.AccAddress, valAddr sdk.AccAddress)
AfterValidatorBeginUnbonding - call hook if registered
func (StakingKeeper) AfterValidatorBonded ¶
func (k StakingKeeper) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.AccAddress, valAddr sdk.AccAddress)
AfterValidatorBonded - call hook if registered
func (StakingKeeper) AfterValidatorCreated ¶
func (k StakingKeeper) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.AccAddress)
func (StakingKeeper) AfterValidatorRemoved ¶
func (k StakingKeeper) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.AccAddress, valAddr sdk.AccAddress)
AfterValidatorRemoved - call hook if registered
func (StakingKeeper) ApplyAndReturnValidatorSetUpdates ¶
func (k StakingKeeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abcitypes.ValidatorUpdate)
func (StakingKeeper) BeforeDelegationCreated ¶
func (k StakingKeeper) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress)
BeforeDelegationCreated - call hook if registered
func (StakingKeeper) BeforeDelegationRemoved ¶
func (k StakingKeeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress)
BeforeDelegationRemoved - call hook if registered
func (StakingKeeper) BeforeDelegationSharesModified ¶
func (k StakingKeeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress)
func (StakingKeeper) BeforeValidatorModified ¶
func (k StakingKeeper) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.AccAddress)
BeforeValidatorModified - call hook if registered
func (StakingKeeper) BeforeValidatorSlashed ¶
func (k StakingKeeper) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.AccAddress, fraction sdk.Dec)
BeforeValidatorSlashed - call hook if registered
func (StakingKeeper) BlockValidatorUpdates ¶
func (k StakingKeeper) BlockValidatorUpdates(ctx sdk.Context) []abcitypes.ValidatorUpdate
func (StakingKeeper) BondDenom ¶
func (k StakingKeeper) BondDenom(ctx sdk.Context) (bondDenom string)
func (StakingKeeper) BondedRatio ¶
func (k StakingKeeper) BondedRatio(ctx sdk.Context) sdk.Dec
BondedRatio the fraction of the staking tokens which are currently bonded
func (StakingKeeper) BondedTokensToMoudleAccount ¶ added in v1.5.53
func (StakingKeeper) CompleteRedelegationWithAmount ¶
func (k StakingKeeper) CompleteRedelegationWithAmount( ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.AccAddress, ) (sdk.Coins, error)
CompleteRedelegationWithAmount completes the redelegations of all mature entries in the retrieved redelegation object and returns the total redelegation (initial) balance or an error upon failure.
func (StakingKeeper) CompleteUnbondingWithAmount ¶
func (k StakingKeeper) CompleteUnbondingWithAmount(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress) (sdk.Coins, error)
CompleteUnbondingWithAmount completes the unbonding of all mature entries in the retrieved unbonding delegation object and returns the total unbonding balance or an error upon failure.
func (StakingKeeper) Delegate ¶
func (k StakingKeeper) Delegate(ctx sdk.Context, delAddr sdk.AccAddress, bondAmt sdk.Int, tokenSrc sdk.BondStatus, validator types.Validator, subtractAccount bool) (newShares sdk.Dec, err error)
func (StakingKeeper) Delegation ¶
func (k StakingKeeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk.AccAddress) exported.DelegationI
Delegation get the delegation interface for a particular set of delegator and validator addresses
func (StakingKeeper) DeleteHistoricalInfo ¶
func (k StakingKeeper) DeleteHistoricalInfo(ctx sdk.Context, height int64)
DeleteHistoricalInfo deletes the historical info at a given height
func (StakingKeeper) DeleteLastValidatorPower ¶
func (k StakingKeeper) DeleteLastValidatorPower(ctx sdk.Context, operator sdk.AccAddress)
Delete the last validator power.
func (StakingKeeper) DeleteValidatorByPowerIndex ¶
func (k StakingKeeper) DeleteValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)
func (StakingKeeper) DeleteValidatorQueue ¶
func (k StakingKeeper) DeleteValidatorQueue(ctx sdk.Context, val types.Validator)
Delete a validator address from the validator queue
func (StakingKeeper) DeleteValidatorQueueTimeSlice ¶
func (k StakingKeeper) DeleteValidatorQueueTimeSlice(ctx sdk.Context, timestamp time.Time)
Deletes a specific validator queue timeslice.
func (StakingKeeper) DequeueAllMatureRedelegationQueue ¶
func (k StakingKeeper) DequeueAllMatureRedelegationQueue(ctx sdk.Context, currTime time.Time) (matureRedelegations []types.DVVTriplet)
Returns a concatenated list of all the timeslices inclusively previous to currTime, and deletes the timeslices from the queue
func (StakingKeeper) DequeueAllMatureUBDQueue ¶
func (k StakingKeeper) DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []types.DVPair)
Returns a concatenated list of all the timeslices inclusively previous to currTime, and deletes the timeslices from the queue
func (StakingKeeper) GetAllDelegations ¶ added in v1.5.23
func (k StakingKeeper) GetAllDelegations(ctx sdk.Context) (delegations []types.Delegation)
GetAllDelegations returns all delegations used during genesis dump
func (StakingKeeper) GetAllDelegatorDelegations ¶
func (k StakingKeeper) GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []types.Delegation
return all delegations for a delegator
func (StakingKeeper) GetAllRedelegations ¶
func (k StakingKeeper) GetAllRedelegations( ctx sdk.Context, delegator sdk.AccAddress, srcValAddress, dstValAddress sdk.AccAddress, ) []types.Redelegation
return all redelegations for a delegator
func (StakingKeeper) GetAllValidators ¶
func (k StakingKeeper) GetAllValidators(ctx sdk.Context) (validators []types.Validator)
get the set of all validators with no limits, used during genesis dump
func (StakingKeeper) GetBondedPool ¶
func (k StakingKeeper) GetBondedPool(ctx sdk.Context) (bondedPool exported.ModuleAccountI)
GetBondedPool returns the bonded tokens pool's module account
func (StakingKeeper) GetBondedValidatorsByPower ¶
func (k StakingKeeper) GetBondedValidatorsByPower(ctx sdk.Context) []types.Validator
func (StakingKeeper) GetDelegation ¶
func (k StakingKeeper) GetDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress) (delegation types.Delegation, found bool)
func (StakingKeeper) GetDelegatorValidator ¶
func (k StakingKeeper) GetDelegatorValidator( ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.AccAddress, ) (validator types.Validator, err error)
return a validator that a delegator is bonded to
func (StakingKeeper) GetDelegatorValidators ¶
func (k StakingKeeper) GetDelegatorValidators( ctx sdk.Context, delegatorAddr sdk.AccAddress, maxRetrieve uint32, ) ([]types.Validator, error)
Return all validators that a delegator is bonded to. If maxRetrieve is supplied, the respective amount will be returned.
func (StakingKeeper) GetHistoricalInfo ¶
func (k StakingKeeper) GetHistoricalInfo(ctx sdk.Context, height int64) (types.HistoricalInfo, bool)
func (StakingKeeper) GetLastTotalPower ¶
func (k StakingKeeper) GetLastTotalPower(ctx sdk.Context) sdk.Int
Load the last total validator power.
func (StakingKeeper) GetLastValidatorPower ¶
func (k StakingKeeper) GetLastValidatorPower(ctx sdk.Context, operator sdk.AccAddress) (power int64)
func (StakingKeeper) GetLastValidators ¶
func (k StakingKeeper) GetLastValidators(ctx sdk.Context) (validators []types.Validator)
func (StakingKeeper) GetNotBondedPool ¶
func (k StakingKeeper) GetNotBondedPool(ctx sdk.Context) (notBondedPool exported.ModuleAccountI)
GetNotBondedPool returns the not bonded tokens pool's module account
func (StakingKeeper) GetRedelegation ¶
func (k StakingKeeper) GetRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.AccAddress) (red types.Redelegation, found bool)
return a redelegation
func (StakingKeeper) GetRedelegationQueueTimeSlice ¶
func (k StakingKeeper) GetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvvTriplets []types.DVVTriplet)
Gets a specific redelegation queue timeslice. A timeslice is a slice of DVVTriplets corresponding to redelegations that expire at a certain time.
func (StakingKeeper) GetRedelegationsFromSrcValidator ¶
func (k StakingKeeper) GetRedelegationsFromSrcValidator(ctx sdk.Context, valAddr sdk.AccAddress) (reds []types.Redelegation)
return all redelegations from a particular validator
func (StakingKeeper) GetUBDQueueTimeSlice ¶
func (StakingKeeper) GetUnbondingDelegation ¶
func (k StakingKeeper) GetUnbondingDelegation( ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress, ) (ubd types.UnbondingDelegation, found bool)
return a unbonding delegation
func (StakingKeeper) GetUnbondingDelegations ¶
func (k StakingKeeper) GetUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (unbondingDelegations []types.UnbondingDelegation)
return a given amount of all the delegator unbonding-delegations
func (StakingKeeper) GetUnbondingDelegationsFromValidator ¶
func (k StakingKeeper) GetUnbondingDelegationsFromValidator(ctx sdk.Context, valAddr sdk.AccAddress) (ubds []types.UnbondingDelegation)
return all unbonding delegations from a particular validator
func (StakingKeeper) GetValidator ¶
func (k StakingKeeper) GetValidator(ctx sdk.Context, addr sdk.AccAddress) (validator types.Validator, found bool)
func (StakingKeeper) GetValidatorByConsAddr ¶
func (k StakingKeeper) GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.AccAddress) (validator types.Validator, found bool)
func (StakingKeeper) GetValidatorDelegations ¶
func (k StakingKeeper) GetValidatorDelegations(ctx sdk.Context, valAddr sdk.AccAddress) (delegations []types.Delegation)
return all delegations to a specific validator. Useful for querier.
func (StakingKeeper) GetValidatorQueueTimeSlice ¶
func (k StakingKeeper) GetValidatorQueueTimeSlice(ctx sdk.Context, timestamp time.Time) []sdk.AccAddress
gets a specific validator queue timeslice. A timeslice is a slice of ValAddresses corresponding to unbonding validators that expire at a certain time.
func (StakingKeeper) HasMaxRedelegationEntries ¶
func (k StakingKeeper) HasMaxRedelegationEntries(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorSrcAddr, validatorDstAddr sdk.AccAddress) bool
HasMaxRedelegationEntries - redelegation has maximum number of entries
func (StakingKeeper) HasMaxUnbondingDelegationEntries ¶
func (k StakingKeeper) HasMaxUnbondingDelegationEntries(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.AccAddress) bool
HasMaxUnbondingDelegationEntries - check if unbonding delegation has maximum number of entries
func (StakingKeeper) HasReceivingRedelegation ¶
func (k StakingKeeper) HasReceivingRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valDstAddr sdk.AccAddress) bool
func (StakingKeeper) HistoricalEntries ¶
func (k StakingKeeper) HistoricalEntries(ctx sdk.Context) (HisEntries uint32)
func (StakingKeeper) InsertRedelegationQueue ¶
func (k StakingKeeper) InsertRedelegationQueue(ctx sdk.Context, red types.Redelegation, completionTime time.Time)
func (StakingKeeper) InsertUBDQueue ¶
func (k StakingKeeper) InsertUBDQueue(ctx sdk.Context, ubd types.UnbondingDelegation, completionTime time.Time)
func (StakingKeeper) InsertValidatorQueue ¶
func (k StakingKeeper) InsertValidatorQueue(ctx sdk.Context, val types.Validator)
Insert an validator address to the appropriate timeslice in the validator queue
func (StakingKeeper) IterateAllDelegations ¶ added in v1.5.23
func (k StakingKeeper) IterateAllDelegations(ctx sdk.Context, cb func(delegation types.Delegation) (stop bool))
IterateAllDelegations iterate through all of the delegations
func (StakingKeeper) IterateLastValidators ¶ added in v1.5.23
func (k StakingKeeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, validator types2.Validator) (stop bool))
iterate through the active validator set and perform the provided function
func (StakingKeeper) IterateValidators ¶
func (k StakingKeeper) IterateValidators(ctx sdk.Context, fn func(index int64, validator types.Validator) (stop bool))
iterate through the validator set and perform the provided function
func (StakingKeeper) Jail ¶
func (k StakingKeeper) Jail(ctx sdk.Context, consAddr sdk.AccAddress)
jail a validator
func (StakingKeeper) LastValidatorsIterator ¶
func (k StakingKeeper) LastValidatorsIterator(ctx sdk.Context) (iterator sdk.Iterator)
returns an iterator for the consensus validators in the last block
func (StakingKeeper) MaxEntries ¶
func (k StakingKeeper) MaxEntries(ctx sdk.Context) (maxEntries uint32)
func (StakingKeeper) MaxValidators ¶
func (k StakingKeeper) MaxValidators(ctx sdk.Context) (maxValidators uint32)
func (StakingKeeper) NotBondedTokensToModuleAccount ¶ added in v1.5.53
func (StakingKeeper) Redelegate ¶
func (k StakingKeeper) Redelegate(ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.AccAddress, sharesAmount sdk.Dec) (completionTime time.Time, err error)
func (StakingKeeper) RedelegationQueueIterator ¶
Returns all the redelegation queue timeslices from time 0 until endTime
func (StakingKeeper) RemoveDelegation ¶
func (k StakingKeeper) RemoveDelegation(ctx sdk.Context, delegation types.Delegation)
remove a delegation
func (StakingKeeper) RemoveRedelegation ¶
func (k StakingKeeper) RemoveRedelegation(ctx sdk.Context, red types.Redelegation)
remove a redelegation object and associated index
func (StakingKeeper) RemoveUnbondingDelegation ¶
func (k StakingKeeper) RemoveUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation)
remove the unbonding delegation object and associated index
func (StakingKeeper) RemoveValidator ¶
func (k StakingKeeper) RemoveValidator(ctx sdk.Context, address sdk.AccAddress)
func (StakingKeeper) RemoveValidatorTokens ¶
func (k StakingKeeper) RemoveValidatorTokens(ctx sdk.Context, validator types.Validator, tokensToRemove sdk.Int) types.Validator
Update the tokens of an existing validator, update the validators power index key
func (StakingKeeper) RemoveValidatorTokensAndShares ¶
func (k StakingKeeper) RemoveValidatorTokensAndShares(ctx sdk.Context, validator types.Validator, sharesToRemove sdk.Dec) (valOut types.Validator, removedTokens sdk.Int)
Update the tokens of an existing validator, update the validators power index key
func (StakingKeeper) SetDelegation ¶
func (k StakingKeeper) SetDelegation(ctx sdk.Context, delegation types.Delegation)
func (StakingKeeper) SetHistoricalInfo ¶
func (k StakingKeeper) SetHistoricalInfo(ctx sdk.Context, height int64, hi types.HistoricalInfo)
SetHistoricalInfo sets the historical info at a given height
func (*StakingKeeper) SetHooks ¶
func (k *StakingKeeper) SetHooks(sh types.StakingHooks) *StakingKeeper
func (StakingKeeper) SetLastTotalPower ¶
func (k StakingKeeper) SetLastTotalPower(ctx sdk.Context, power sdk.Int)
Set the last total validator power.
func (StakingKeeper) SetLastValidatorPower ¶
func (k StakingKeeper) SetLastValidatorPower(ctx sdk.Context, operator sdk.AccAddress, power int64)
Set the last validator power.
func (StakingKeeper) SetNewValidatorByPowerIndex ¶
func (k StakingKeeper) SetNewValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)
func (StakingKeeper) SetParams ¶
func (k StakingKeeper) SetParams(ctx sdk.Context, params types.Params)
func (StakingKeeper) SetRedelegation ¶
func (k StakingKeeper) SetRedelegation(ctx sdk.Context, red types.Redelegation)
set a redelegation and associated index
func (StakingKeeper) SetRedelegationEntry ¶
func (k StakingKeeper) SetRedelegationEntry(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorSrcAddr, validatorDstAddr sdk.AccAddress, creationHeight int64, minTime time.Time, balance sdk.Int, sharesSrc, sharesDst sdk.Dec) types.Redelegation
func (StakingKeeper) SetRedelegationQueueTimeSlice ¶
func (k StakingKeeper) SetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DVVTriplet)
Sets a specific redelegation queue timeslice.
func (StakingKeeper) SetUBDQueueTimeSlice ¶
func (k StakingKeeper) SetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DVPair)
Sets a specific unbonding queue timeslice.
func (StakingKeeper) SetUnbondingDelegation ¶
func (k StakingKeeper) SetUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation)
set the unbonding delegation and associated index
func (StakingKeeper) SetUnbondingDelegationEntry ¶
func (k StakingKeeper) SetUnbondingDelegationEntry(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.AccAddress, creationHeight int64, minTime time.Time, balance sdk.Int) types.UnbondingDelegation
func (StakingKeeper) SetValidator ¶
func (StakingKeeper) SetValidatorByConsAddr ¶
func (k StakingKeeper) SetValidatorByConsAddr(ctx sdk.Context, validator types.Validator)
func (StakingKeeper) SetValidatorByPowerIndex ¶
func (k StakingKeeper) SetValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)
func (StakingKeeper) SetValidatorQueueTimeSlice ¶
func (k StakingKeeper) SetValidatorQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []sdk.AccAddress)
Sets a specific validator queue timeslice.
func (StakingKeeper) Slash ¶
func (k StakingKeeper) Slash(ctx sdk.Context, consAddr sdk.AccAddress, infractionHeight int64, power int64, slashFactor sdk.Dec)
Slash a validator for an infraction committed at a known height Find the contributing stake at that height and burn the specified slashFactor of it, updating unbonding delegations & redelegations appropriately
CONTRACT:
slashFactor is non-negative
CONTRACT:
Infraction was committed equal to or less than an unbonding period in the past, so all unbonding delegations and redelegations from that height are stored
CONTRACT:
Slash will not slash unbonded validators (for the above reason)
CONTRACT:
Infraction was committed at the current height or at a past height, not at a height in the future
func (StakingKeeper) SlashRedelegation ¶
func (k StakingKeeper) SlashRedelegation(ctx sdk.Context, srcValidator types.Validator, redelegation types.Redelegation, infractionHeight int64, slashFactor sdk.Dec) (totalSlashAmount sdk.Int)
slash a redelegation and update the pool return the amount that would have been slashed assuming the unbonding delegation had enough stake to slash (the amount actually slashed may be less if there's insufficient stake remaining) NOTE this is only slashing for prior infractions from the source validator
func (StakingKeeper) SlashUnbondingDelegation ¶
func (k StakingKeeper) SlashUnbondingDelegation(ctx sdk.Context, unbondingDelegation types.UnbondingDelegation, infractionHeight int64, slashFactor sdk.Dec) (totalSlashAmount sdk.Int)
slash an unbonding delegation and update the pool return the amount that would have been slashed assuming the unbonding delegation had enough stake to slash (the amount actually slashed may be less if there's insufficient stake remaining)
func (StakingKeeper) StakingTokenSupply ¶
func (k StakingKeeper) StakingTokenSupply(ctx sdk.Context) sdk.Int
StakingTokenSupply staking tokens from the total supply
func (StakingKeeper) TotalBondedTokens ¶
func (k StakingKeeper) TotalBondedTokens(ctx sdk.Context) sdk.Int
TotalBondedTokens total staking tokens supply which is bonded
func (StakingKeeper) TrackHistoricalInfo ¶
func (k StakingKeeper) TrackHistoricalInfo(ctx sdk.Context)
func (StakingKeeper) UBDQueueIterator ¶
Returns all the unbonding queue timeslices from time 0 until endTime
func (StakingKeeper) Unbond ¶ added in v1.5.53
func (k StakingKeeper) Unbond(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress, shares sdk.Dec) (amount sdk.Int, err error)
func (StakingKeeper) UnbondAllMatureValidatorQueue ¶
func (k StakingKeeper) UnbondAllMatureValidatorQueue(ctx sdk.Context)
Unbonds all the unbonding validators that have finished their unbonding period
func (StakingKeeper) UnbondingTime ¶
func (k StakingKeeper) UnbondingTime(ctx sdk.Context) (unbondingTime time.Duration)
func (StakingKeeper) Undelegate ¶
func (k StakingKeeper) Undelegate(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress, sharesAmount sdk.Dec) (time.Time, error)
func (StakingKeeper) Unjail ¶
func (k StakingKeeper) Unjail(ctx sdk.Context, consAddr sdk.AccAddress)
unjail a validator
func (StakingKeeper) UpdateValidatorCommission ¶
func (k StakingKeeper) UpdateValidatorCommission(ctx sdk.Context, validator types.Validator, newRate sdk.Dec) (types.Commission, error)
func (StakingKeeper) ValidateUnbondAmount ¶
func (k StakingKeeper) ValidateUnbondAmount(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress, amt sdk.Int) (shares sdk.Dec, err error)
func (StakingKeeper) Validator ¶
func (k StakingKeeper) Validator(ctx sdk.Context, address sdk.AccAddress) exported.ValidatorI
Validator gets the Validator interface for a particular address
func (StakingKeeper) ValidatorQueueIterator ¶
Returns all the validator queue timeslices from time 0 until endTime
func (StakingKeeper) ValidatorsPowerStoreIterator ¶
func (k StakingKeeper) ValidatorsPowerStoreIterator(ctx sdk.Context) sdk.Iterator
returns an iterator for the current validator power store