Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func DelegationToDelegationResponse(ctx sdk.Context, k Keeper, del types.Delegation) (types.DelegationResponse, error)
- func DelegationsToDelegationResponses(ctx sdk.Context, k Keeper, delegations types.Delegations) (types.DelegationResponses, error)
- func DelegatorSharesInvariant(k Keeper) sdk.Invariant
- func ModuleAccountInvariants(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- func NonNegativePowerInvariant(k Keeper) sdk.Invariant
- func PositiveDelegationInvariant(k Keeper) sdk.Invariant
- func RandomValidator(r *rand.Rand, keeper Keeper, ctx sdk.Context) (val types.Validator, ok bool)
- func RedelegationsToRedelegationResponses(ctx sdk.Context, k Keeper, redels types.Redelegations) (types.RedelegationResponses, error)
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- func TestingUpdateValidator(keeper Keeper, ctx sdk.Context, validator types.Validator, apply bool) types.Validator
- func ValidatorByPowerIndexExists(ctx sdk.Context, keeper Keeper, power []byte) bool
- type Keeper
- func (k Keeper) AccountIsLiquidStakingProvider(ctx sdk.Context, address sdk.AccAddress) bool
- func (k Keeper) AddTokenizeShareRecord(ctx sdk.Context, tokenizeShareRecord types.TokenizeShareRecord) error
- func (k Keeper) AddValidatorTokensAndShares(ctx sdk.Context, validator types.Validator, tokensToAdd math.Int) (valOut types.Validator, addedShares sdk.Dec)
- func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (k Keeper) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (k Keeper) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abci.ValidatorUpdate, err error)
- func (k Keeper) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeTokenizeShareRecordRemoved(ctx sdk.Context, recordId uint64) error
- func (k Keeper) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error
- func (k Keeper) BeginRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, ...) (completionTime time.Time, err error)
- func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate
- func (k Keeper) BondDenom(ctx sdk.Context) (res string)
- func (k Keeper) BondedRatio(ctx sdk.Context) sdk.Dec
- func (k Keeper) CheckExceedsGlobalLiquidStakingCap(ctx sdk.Context, tokens sdk.Int) bool
- func (k Keeper) CheckExceedsValidatorBondCap(ctx sdk.Context, validator types.Validator, shares sdk.Dec) bool
- func (k Keeper) CompleteRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) (sdk.Coins, error)
- func (k Keeper) CompleteUnbonding(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error)
- func (k Keeper) DecreaseTotalLiquidStakedTokens(ctx sdk.Context, amount sdk.Int)
- func (k Keeper) DecreaseValidatorTotalLiquidShares(ctx sdk.Context, validator types.Validator, shares sdk.Dec)
- func (k Keeper) Delegate(ctx sdk.Context, delAddr sdk.AccAddress, bondAmt math.Int, ...) (newShares sdk.Dec, err error)
- func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk.ValAddress) sdkstaking.DelegationI
- func (k Keeper) DeleteHistoricalInfo(ctx sdk.Context, height int64)
- func (k Keeper) DeleteLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress)
- func (k Keeper) DeleteTokenizeShareRecord(ctx sdk.Context, recordId uint64) error
- func (k Keeper) DeleteValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)
- func (k Keeper) DeleteValidatorQueue(ctx sdk.Context, val types.Validator)
- func (k Keeper) DeleteValidatorQueueTimeSlice(ctx sdk.Context, endTime time.Time, endHeight int64)
- func (k Keeper) DequeueAllMatureRedelegationQueue(ctx sdk.Context, currTime time.Time) (matureRedelegations []types.DVVTriplet)
- func (k Keeper) DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []types.DVPair)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAllDelegations(ctx sdk.Context) (delegations []types.Delegation)
- func (k Keeper) GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []sdkstaking.Delegation
- func (k Keeper) GetAllHistoricalInfo(ctx sdk.Context) []types.HistoricalInfo
- func (k Keeper) GetAllLiquidDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []types.Delegation
- func (k Keeper) GetAllRedelegations(ctx sdk.Context, delegator sdk.AccAddress, ...) []types.Redelegation
- func (k Keeper) GetAllSDKDelegations(ctx sdk.Context) (delegations []types.Delegation)
- func (k Keeper) GetAllTokenizeShareRecords(ctx sdk.Context) (tokenizeShareRecords []types.TokenizeShareRecord)
- func (k Keeper) GetAllUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress) []types.UnbondingDelegation
- func (k Keeper) GetAllValidators(ctx sdk.Context) (validators []types.Validator)
- func (k Keeper) GetBondedPool(ctx sdk.Context) (bondedPool authtypes.ModuleAccountI)
- func (k Keeper) GetBondedValidatorsByPower(ctx sdk.Context) []sdkstaking.Validator
- func (k Keeper) GetDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation sdkstaking.Delegation, found bool)
- func (k Keeper) GetDelegatorBonded(ctx sdk.Context, delegator sdk.AccAddress) math.Int
- func (k Keeper) GetDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (delegations []types.Delegation)
- func (k Keeper) GetDelegatorUnbonding(ctx sdk.Context, delegator sdk.AccAddress) math.Int
- func (k Keeper) GetDelegatorValidator(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) (validator types.Validator, err error)
- func (k Keeper) GetDelegatorValidators(ctx sdk.Context, delegatorAddr sdk.AccAddress, maxRetrieve uint32) types.Validators
- func (k Keeper) GetHistoricalInfo(ctx sdk.Context, height int64) (sdkstaking.HistoricalInfo, bool)
- func (k Keeper) GetLastTokenizeShareRecordId(ctx sdk.Context) uint64
- func (k Keeper) GetLastTotalPower(ctx sdk.Context) math.Int
- func (k Keeper) GetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress) (power int64)
- func (k Keeper) GetLastValidators(ctx sdk.Context) (validators []types.Validator)
- func (k Keeper) GetLiquidBondedValidatorsByPower(ctx sdk.Context) []types.Validator
- func (k Keeper) GetLiquidDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation types.Delegation, found bool)
- func (k Keeper) GetLiquidStakingHistoricalInfo(ctx sdk.Context, height int64) (types.HistoricalInfo, bool)
- func (k Keeper) GetLiquidValidator(ctx sdk.Context, addr sdk.ValAddress) (validator types.Validator, found bool)
- func (k Keeper) GetNotBondedPool(ctx sdk.Context) (notBondedPool authtypes.ModuleAccountI)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) (red types.Redelegation, found bool)
- func (k Keeper) GetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvvTriplets []types.DVVTriplet)
- func (k Keeper) GetRedelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (redelegations []types.Redelegation)
- func (k Keeper) GetRedelegationsFromSrcValidator(ctx sdk.Context, valAddr sdk.ValAddress) (reds []types.Redelegation)
- func (k Keeper) GetTokenizeShareRecord(ctx sdk.Context, id uint64) (tokenizeShareRecord types.TokenizeShareRecord, err error)
- func (k Keeper) GetTokenizeShareRecordByDenom(ctx sdk.Context, denom string) (types.TokenizeShareRecord, error)
- func (k Keeper) GetTokenizeShareRecordsByOwner(ctx sdk.Context, owner sdk.AccAddress) (tokenizeShareRecords []types.TokenizeShareRecord)
- func (k Keeper) GetTotalLiquidStakedTokens(ctx sdk.Context) sdk.Int
- func (k Keeper) GetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvPairs []types.DVPair)
- func (k Keeper) GetUnbondingDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (ubd types.UnbondingDelegation, found bool)
- func (k Keeper) GetUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (unbondingDelegations []types.UnbondingDelegation)
- func (k Keeper) GetUnbondingDelegationsFromValidator(ctx sdk.Context, valAddr sdk.ValAddress) (ubds []types.UnbondingDelegation)
- func (k Keeper) GetUnbondingValidators(ctx sdk.Context, endTime time.Time, endHeight int64) []string
- func (k Keeper) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator sdkstaking.Validator, found bool)
- func (k Keeper) GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (validator types.Validator, found bool)
- func (k Keeper) GetValidatorDelegations(ctx sdk.Context, valAddr sdk.ValAddress) (delegations []types.Delegation)
- func (k Keeper) GetValidatorSet() types.ValidatorSet
- func (k Keeper) GetValidators(ctx sdk.Context, maxRetrieve uint32) (validators []types.Validator)
- func (k Keeper) GlobalLiquidStakingCap(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) GlobalLiquidStakingCapEnabled(ctx sdk.Context) bool
- func (k Keeper) HasMaxRedelegationEntries(ctx sdk.Context, delegatorAddr sdk.AccAddress, ...) bool
- func (k Keeper) HasMaxUnbondingDelegationEntries(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) bool
- func (k Keeper) HasReceivingRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valDstAddr sdk.ValAddress) bool
- func (k Keeper) HistoricalEntries(ctx sdk.Context) (res uint32)
- func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) (res []abci.ValidatorUpdate)
- func (k Keeper) InsertRedelegationQueue(ctx sdk.Context, red types.Redelegation, completionTime time.Time)
- func (k Keeper) InsertUBDQueue(ctx sdk.Context, ubd types.UnbondingDelegation, completionTime time.Time)
- func (k Keeper) InsertUnbondingValidatorQueue(ctx sdk.Context, val types.Validator)
- func (k Keeper) IterateAllDelegations(ctx sdk.Context, cb func(delegation types.Delegation) (stop bool))
- func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, ...)
- func (k Keeper) IterateDelegations(ctx sdk.Context, delAddr sdk.AccAddress, ...)
- func (k Keeper) IterateDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress, ...)
- func (k Keeper) IterateDelegatorRedelegations(ctx sdk.Context, delegator sdk.AccAddress, ...)
- func (k Keeper) IterateDelegatorUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress, ...)
- func (k Keeper) IterateHistoricalInfo(ctx sdk.Context, cb func(types.HistoricalInfo) bool)
- func (k Keeper) IterateLastValidatorPowers(ctx sdk.Context, ...)
- func (k Keeper) IterateLastValidators(ctx sdk.Context, ...)
- func (k Keeper) IterateRedelegations(ctx sdk.Context, fn func(index int64, red types.Redelegation) (stop bool))
- func (k Keeper) IterateUnbondingDelegations(ctx sdk.Context, ...)
- func (k Keeper) IterateValidators(ctx sdk.Context, ...)
- func (k Keeper) Jail(ctx sdk.Context, consAddr sdk.ConsAddress)
- func (k Keeper) LastValidatorsIterator(ctx sdk.Context) (iterator sdk.Iterator)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MaxEntries(ctx sdk.Context) (res uint32)
- func (k Keeper) MaxValidators(ctx sdk.Context) (res uint32)
- func (k Keeper) MinCommissionRate(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) PowerReduction(ctx sdk.Context) math.Int
- func (k Keeper) RedelegationQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (k Keeper) RemoveDelegation(ctx sdk.Context, delegation types.Delegation) error
- func (k Keeper) RemoveRedelegation(ctx sdk.Context, red types.Redelegation)
- func (k Keeper) RemoveUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation)
- func (k Keeper) RemoveValidator(ctx sdk.Context, address sdk.ValAddress)
- func (k Keeper) RemoveValidatorTokens(ctx sdk.Context, validator types.Validator, tokensToRemove math.Int) types.Validator
- func (k Keeper) RemoveValidatorTokensAndShares(ctx sdk.Context, validator types.Validator, sharesToRemove sdk.Dec) (valOut types.Validator, removedTokens math.Int)
- func (k Keeper) SafelyDecreaseValidatorBond(ctx sdk.Context, validator types.Validator, shares sdk.Dec) error
- func (k Keeper) SafelyIncreaseTotalLiquidStakedTokens(ctx sdk.Context, amount sdk.Int) error
- func (k Keeper) SafelyIncreaseValidatorTotalLiquidShares(ctx sdk.Context, validator types.Validator, shares sdk.Dec) error
- func (k Keeper) SetDelegation(ctx sdk.Context, delegation types.Delegation)
- func (k Keeper) SetHistoricalInfo(ctx sdk.Context, height int64, hi *types.HistoricalInfo)
- func (k *Keeper) SetHooks(sh types.StakingHooks) *Keeper
- func (k Keeper) SetLastTokenizeShareRecordId(ctx sdk.Context, id uint64)
- func (k Keeper) SetLastTotalPower(ctx sdk.Context, power math.Int)
- func (k Keeper) SetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress, power int64)
- func (k Keeper) SetNewValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetRedelegation(ctx sdk.Context, red types.Redelegation)
- func (k Keeper) SetRedelegationEntry(ctx sdk.Context, delegatorAddr sdk.AccAddress, ...) types.Redelegation
- func (k Keeper) SetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DVVTriplet)
- func (k Keeper) SetTotalLiquidStakedTokens(ctx sdk.Context, tokens sdk.Int)
- func (k Keeper) SetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DVPair)
- func (k Keeper) SetUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation)
- func (k Keeper) SetUnbondingDelegationEntry(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, ...) types.UnbondingDelegation
- func (k Keeper) SetUnbondingValidatorsQueue(ctx sdk.Context, endTime time.Time, endHeight int64, addrs []string)
- func (k Keeper) SetValidator(ctx sdk.Context, validator types.Validator)
- func (k Keeper) SetValidatorByConsAddr(ctx sdk.Context, validator types.Validator) error
- func (k Keeper) SetValidatorByPowerIndex(ctx sdk.Context, validator types.Validator)
- func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeight int64, power int64, ...) math.Int
- func (k Keeper) SlashRedelegation(ctx sdk.Context, srcValidator types.Validator, redelegation types.Redelegation, ...) (totalSlashAmount math.Int)
- func (k Keeper) SlashUnbondingDelegation(ctx sdk.Context, unbondingDelegation types.UnbondingDelegation, ...) (totalSlashAmount math.Int)
- func (k Keeper) StakingTokenSupply(ctx sdk.Context) math.Int
- func (k Keeper) TokensFromConsensusPower(ctx sdk.Context, power int64) math.Int
- func (k Keeper) TokensToConsensusPower(ctx sdk.Context, tokens math.Int) int64
- func (k Keeper) TotalBondedTokens(ctx sdk.Context) math.Int
- func (k Keeper) TrackHistoricalInfo(ctx sdk.Context)
- func (k Keeper) UBDQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (k Keeper) Unbond(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, ...) (amount math.Int, err error)
- func (k Keeper) UnbondAllMatureValidators(ctx sdk.Context)
- func (k Keeper) UnbondingTime(ctx sdk.Context) (res time.Duration)
- func (k Keeper) UnbondingToUnbonded(ctx sdk.Context, validator types.Validator) types.Validator
- func (k Keeper) Undelegate(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, ...) (time.Time, error)
- func (k Keeper) Unjail(ctx sdk.Context, consAddr sdk.ConsAddress)
- func (k Keeper) UpdateValidatorCommission(ctx sdk.Context, validator types.Validator, newRate sdk.Dec) (types.Commission, error)
- func (k Keeper) ValidateUnbondAmount(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt math.Int) (shares sdk.Dec, err error)
- func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) sdkstaking.ValidatorI
- func (k Keeper) ValidatorBondFactor(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) ValidatorBondFactorEnabled(ctx sdk.Context) bool
- func (k Keeper) ValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) sdkstaking.ValidatorI
- func (k Keeper) ValidatorQueueIterator(ctx sdk.Context, endTime time.Time, endHeight int64) sdk.Iterator
- func (k Keeper) ValidatorsPowerStoreIterator(ctx sdk.Context) sdk.Iterator
- type Migrator
- type Querier
- func (k Querier) AllTokenizeShareRecords(c context.Context, req *types.QueryAllTokenizeShareRecordsRequest) (*types.QueryAllTokenizeShareRecordsResponse, error)
- func (k Querier) Delegation(c context.Context, req *types.QueryDelegationRequest) (*types.QueryDelegationResponse, error)
- func (k Querier) DelegatorDelegations(c context.Context, req *types.QueryDelegatorDelegationsRequest) (*types.QueryDelegatorDelegationsResponse, error)
- func (k Querier) DelegatorUnbondingDelegations(c context.Context, req *types.QueryDelegatorUnbondingDelegationsRequest) (*types.QueryDelegatorUnbondingDelegationsResponse, error)
- func (k Querier) DelegatorValidator(c context.Context, req *types.QueryDelegatorValidatorRequest) (*types.QueryDelegatorValidatorResponse, error)
- func (k Querier) DelegatorValidators(c context.Context, req *types.QueryDelegatorValidatorsRequest) (*types.QueryDelegatorValidatorsResponse, error)
- func (k Querier) HistoricalInfo(c context.Context, req *types.QueryHistoricalInfoRequest) (*types.QueryHistoricalInfoResponse, error)
- func (k Querier) LastTokenizeShareRecordId(c context.Context, req *types.QueryLastTokenizeShareRecordIdRequest) (*types.QueryLastTokenizeShareRecordIdResponse, error)
- func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Querier) Pool(c context.Context, _ *types.QueryPoolRequest) (*types.QueryPoolResponse, error)
- func (k Querier) Redelegations(c context.Context, req *types.QueryRedelegationsRequest) (*types.QueryRedelegationsResponse, error)
- func (k Querier) TokenizeShareRecordByDenom(c context.Context, req *types.QueryTokenizeShareRecordByDenomRequest) (*types.QueryTokenizeShareRecordByDenomResponse, error)
- func (k Querier) TokenizeShareRecordById(c context.Context, req *types.QueryTokenizeShareRecordByIdRequest) (*types.QueryTokenizeShareRecordByIdResponse, error)
- func (k Querier) TokenizeShareRecordsOwned(c context.Context, req *types.QueryTokenizeShareRecordsOwnedRequest) (*types.QueryTokenizeShareRecordsOwnedResponse, error)
- func (k Querier) TotalTokenizeSharedAssets(c context.Context, req *types.QueryTotalTokenizeSharedAssetsRequest) (*types.QueryTotalTokenizeSharedAssetsResponse, error)
- func (k Querier) UnbondingDelegation(c context.Context, req *types.QueryUnbondingDelegationRequest) (*types.QueryUnbondingDelegationResponse, error)
- func (k Querier) Validator(c context.Context, req *types.QueryValidatorRequest) (*types.QueryValidatorResponse, error)
- func (k Querier) ValidatorDelegations(c context.Context, req *types.QueryValidatorDelegationsRequest) (*types.QueryValidatorDelegationsResponse, error)
- func (k Querier) ValidatorUnbondingDelegations(c context.Context, req *types.QueryValidatorUnbondingDelegationsRequest) (*types.QueryValidatorUnbondingDelegationsResponse, error)
- func (k Querier) Validators(c context.Context, req *types.QueryValidatorsRequest) (*types.QueryValidatorsResponse, error)
- type SdkMsgHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the staking module.
func DelegationToDelegationResponse ¶
func DelegationToDelegationResponse(ctx sdk.Context, k Keeper, del types.Delegation) (types.DelegationResponse, error)
func DelegationsToDelegationResponses ¶
func DelegationsToDelegationResponses( ctx sdk.Context, k Keeper, delegations types.Delegations, ) (types.DelegationResponses, error)
func DelegatorSharesInvariant ¶
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 ModuleAccountInvariants ¶
ModuleAccountInvariants checks that the bonded and notBonded ModuleAccounts pools reflects the tokens actively bonded and not bonded
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the bank MsgServer interface for the provided Keeper.
func NewQuerier ¶
func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
creates a querier for staking REST endpoints
func NonNegativePowerInvariant ¶
NonNegativePowerInvariant checks that all stored validators have >= 0 power.
func PositiveDelegationInvariant ¶
PositiveDelegationInvariant checks that all stored delegations have > 0 shares.
func RandomValidator ¶
RandomValidator returns a random validator given access to the keeper and ctx
func RedelegationsToRedelegationResponses ¶
func RedelegationsToRedelegationResponses( ctx sdk.Context, k Keeper, redels types.Redelegations, ) (types.RedelegationResponses, error)
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers all staking invariants
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
keeper of the staking store
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, ak types.AccountKeeper, bk types.BankKeeper, ps paramtypes.Subspace, ) Keeper
NewKeeper creates a new staking Keeper instance
func (Keeper) AccountIsLiquidStakingProvider ¶
Check if an account is a owned by a liquid staking provider This is determined by checking if the account is a 32-length module account
func (Keeper) AddTokenizeShareRecord ¶
func (Keeper) AddValidatorTokensAndShares ¶
func (k Keeper) AddValidatorTokensAndShares(ctx sdk.Context, validator types.Validator, tokensToAdd math.Int, ) (valOut types.Validator, addedShares sdk.Dec)
Update the tokens of an existing validator, update the validators power index key
func (Keeper) AfterDelegationModified ¶
func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
AfterDelegationModified - call hook if registered
func (Keeper) AfterValidatorBeginUnbonding ¶
func (k Keeper) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
AfterValidatorBeginUnbonding - call hook if registered
func (Keeper) AfterValidatorBonded ¶
func (k Keeper) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
AfterValidatorBonded - call hook if registered
func (Keeper) AfterValidatorCreated ¶
AfterValidatorCreated - call hook if registered
func (Keeper) AfterValidatorRemoved ¶
func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
AfterValidatorRemoved - call hook if registered
func (Keeper) ApplyAndReturnValidatorSetUpdates ¶
func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abci.ValidatorUpdate, err error)
ApplyAndReturnValidatorSetUpdates applies and return accumulated updates to the bonded validator set. Also, * Updates the active valset as keyed by LastValidatorPowerKey. * Updates the total power as keyed by LastTotalPowerKey. * Updates validator status' according to updated powers. * Updates the fee pool bonded vs not-bonded tokens. * Updates relevant indices. It gets called once after genesis, another time maybe after genesis transactions, then once at every EndBlock.
CONTRACT: Only validators with non-zero power or zero-power that were bonded at the previous block height or were removed from the validator set entirely are returned to Tendermint.
func (Keeper) BeforeDelegationCreated ¶
func (k Keeper) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
BeforeDelegationCreated - call hook if registered
func (Keeper) BeforeDelegationRemoved ¶
func (k Keeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
BeforeDelegationRemoved - call hook if registered
func (Keeper) BeforeDelegationSharesModified ¶
func (k Keeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
BeforeDelegationSharesModified - call hook if registered
func (Keeper) BeforeTokenizeShareRecordRemoved ¶
func (Keeper) BeforeValidatorModified ¶
BeforeValidatorModified - call hook if registered
func (Keeper) BeforeValidatorSlashed ¶
func (k Keeper) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error
BeforeValidatorSlashed - call hook if registered
func (Keeper) BeginRedelegation ¶
func (k Keeper) BeginRedelegation( ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, sharesAmount sdk.Dec, ) (completionTime time.Time, err error)
BeginRedelegation begins unbonding / redelegation and creates a redelegation record.
func (Keeper) BlockValidatorUpdates ¶
func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate
BlockValidatorUpdates calculates the ValidatorUpdates for the current block Called in each EndBlock
func (Keeper) BondedRatio ¶
BondedRatio the fraction of the staking tokens which are currently bonded
func (Keeper) CheckExceedsGlobalLiquidStakingCap ¶
ExceedsGlobalLiquidStakingCap checks if a liquid delegation would cause the global liquid staking cap to be exceeded A liquid delegation is defined as either tokenized shares, or a delegation from an ICA Account The total stake is determined by the balance of the bonded pool Returns true if the cap is exceeded
func (Keeper) CheckExceedsValidatorBondCap ¶
func (k Keeper) CheckExceedsValidatorBondCap(ctx sdk.Context, validator types.Validator, shares sdk.Dec) bool
ExceedsValidatorBondCap checks if a liquid delegation to a validator would cause the liquid shares to exceed the validator bond factor A liquid delegation is defined as either tokenized shares, or a delegation from an ICA Account Returns true if the cap is exceeded
func (Keeper) CompleteRedelegation ¶
func (k Keeper) CompleteRedelegation( ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, ) (sdk.Coins, error)
CompleteRedelegation 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 (Keeper) CompleteUnbonding ¶
func (k Keeper) CompleteUnbonding(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error)
CompleteUnbonding 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 (Keeper) DecreaseTotalLiquidStakedTokens ¶
DecreaseTotalLiquidStakedTokens decrements the total liquid staked tokens if the global cap is enabled
func (Keeper) DecreaseValidatorTotalLiquidShares ¶
func (k Keeper) DecreaseValidatorTotalLiquidShares(ctx sdk.Context, validator types.Validator, shares sdk.Dec)
DecreaseValidatorTotalLiquidShares decrements the total liquid shares on a validator if the validator bond factor is enabled
func (Keeper) Delegate ¶
func (k Keeper) Delegate( ctx sdk.Context, delAddr sdk.AccAddress, bondAmt math.Int, tokenSrc sdkstaking.BondStatus, validator types.Validator, subtractAccount bool, ) (newShares sdk.Dec, err error)
Delegate performs a delegation, set/update everything necessary within the store. tokenSrc indicates the bond status of the incoming funds.
func (Keeper) Delegation ¶
func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk.ValAddress) sdkstaking.DelegationI
Delegation get the delegation interface for a particular set of delegator and validator addresses
func (Keeper) DeleteHistoricalInfo ¶
DeleteHistoricalInfo deletes the historical info at a given height
func (Keeper) DeleteLastValidatorPower ¶
func (k Keeper) DeleteLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress)
Delete the last validator power.
func (Keeper) DeleteTokenizeShareRecord ¶
func (Keeper) DeleteValidatorByPowerIndex ¶
validator index
func (Keeper) DeleteValidatorQueue ¶
DeleteValidatorQueue removes a validator by address from the unbonding queue indexed by a given height and time.
func (Keeper) DeleteValidatorQueueTimeSlice ¶
DeleteValidatorQueueTimeSlice deletes all entries in the queue indexed by a given height and time.
func (Keeper) DequeueAllMatureRedelegationQueue ¶
func (k Keeper) DequeueAllMatureRedelegationQueue(ctx sdk.Context, currTime time.Time) (matureRedelegations []types.DVVTriplet)
DequeueAllMatureRedelegationQueue returns a concatenated list of all the timeslices inclusively previous to currTime, and deletes the timeslices from the queue.
func (Keeper) DequeueAllMatureUBDQueue ¶
func (k Keeper) DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []types.DVPair)
DequeueAllMatureUBDQueue returns a concatenated list of all the timeslices inclusively previous to currTime, and deletes the timeslices from the queue.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *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 (Keeper) GetAllDelegations ¶
func (k Keeper) GetAllDelegations(ctx sdk.Context) (delegations []types.Delegation)
GetAllDelegations returns all delegations used during genesis dump.
func (Keeper) GetAllDelegatorDelegations ¶
func (k Keeper) GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []sdkstaking.Delegation
return all delegations for a delegator
func (Keeper) GetAllHistoricalInfo ¶
func (k Keeper) GetAllHistoricalInfo(ctx sdk.Context) []types.HistoricalInfo
GetAllHistoricalInfo returns all stored HistoricalInfo objects.
func (Keeper) GetAllLiquidDelegatorDelegations ¶
func (k Keeper) GetAllLiquidDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []types.Delegation
return all delegations for a delegator
func (Keeper) GetAllRedelegations ¶
func (k Keeper) GetAllRedelegations( ctx sdk.Context, delegator sdk.AccAddress, srcValAddress, dstValAddress sdk.ValAddress, ) []types.Redelegation
return all redelegations for a delegator
func (Keeper) GetAllSDKDelegations ¶
func (k Keeper) GetAllSDKDelegations(ctx sdk.Context) (delegations []types.Delegation)
return all delegations used during genesis dump TODO: remove this func, change all usage for iterate functionality
func (Keeper) GetAllTokenizeShareRecords ¶
func (k Keeper) GetAllTokenizeShareRecords(ctx sdk.Context) (tokenizeShareRecords []types.TokenizeShareRecord)
func (Keeper) GetAllUnbondingDelegations ¶
func (k Keeper) GetAllUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress) []types.UnbondingDelegation
return all unbonding-delegations for a delegator
func (Keeper) GetAllValidators ¶
get the set of all validators with no limits, used during genesis dump
func (Keeper) GetBondedPool ¶
func (k Keeper) GetBondedPool(ctx sdk.Context) (bondedPool authtypes.ModuleAccountI)
GetBondedPool returns the bonded tokens pool's module account
func (Keeper) GetBondedValidatorsByPower ¶
func (k Keeper) GetBondedValidatorsByPower(ctx sdk.Context) []sdkstaking.Validator
get the current group of bonded validators sorted by power-rank
func (Keeper) GetDelegation ¶
func (k Keeper) GetDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation sdkstaking.Delegation, found bool)
GetDelegation returns a specific delegation.
func (Keeper) GetDelegatorBonded ¶
GetDelegatorBonded returs the total amount a delegator has bonded.
func (Keeper) GetDelegatorDelegations ¶
func (k Keeper) GetDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (delegations []types.Delegation)
GetDelegatorDelegations returns a given amount of all the delegations from a delegator.
func (Keeper) GetDelegatorUnbonding ¶
GetDelegatorUnbonding returns the total amount a delegator has unbonding.
func (Keeper) GetDelegatorValidator ¶
func (k Keeper) GetDelegatorValidator( ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, ) (validator types.Validator, err error)
return a validator that a delegator is bonded to
func (Keeper) GetDelegatorValidators ¶
func (k Keeper) GetDelegatorValidators( ctx sdk.Context, delegatorAddr sdk.AccAddress, maxRetrieve uint32, ) types.Validators
Return all validators that a delegator is bonded to. If maxRetrieve is supplied, the respective amount will be returned.
func (Keeper) GetHistoricalInfo ¶
func (k Keeper) GetHistoricalInfo(ctx sdk.Context, height int64) (sdkstaking.HistoricalInfo, bool)
GetHistoricalInfo gets the historical info at a given height
func (Keeper) GetLastTokenizeShareRecordId ¶
func (Keeper) GetLastTotalPower ¶
Load the last total validator power.
func (Keeper) GetLastValidatorPower ¶
Load the last validator power. Returns zero if the operator was not a validator last block.
func (Keeper) GetLastValidators ¶
get the group of the bonded validators
func (Keeper) GetLiquidBondedValidatorsByPower ¶
get the current group of bonded validators sorted by power-rank
func (Keeper) GetLiquidDelegation ¶
func (k Keeper) GetLiquidDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation types.Delegation, found bool)
GetLiquidDelegation returns a specific delegation.
func (Keeper) GetLiquidStakingHistoricalInfo ¶
func (k Keeper) GetLiquidStakingHistoricalInfo(ctx sdk.Context, height int64) (types.HistoricalInfo, bool)
GetLiquidStakingHistoricalInfo gets the historical info at a given height
func (Keeper) GetLiquidValidator ¶
func (k Keeper) GetLiquidValidator(ctx sdk.Context, addr sdk.ValAddress) (validator types.Validator, found bool)
GetLiquidValidator gets a single validator
func (Keeper) GetNotBondedPool ¶
func (k Keeper) GetNotBondedPool(ctx sdk.Context) (notBondedPool authtypes.ModuleAccountI)
GetNotBondedPool returns the not bonded tokens pool's module account
func (Keeper) GetRedelegation ¶
func (k Keeper) GetRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) (red types.Redelegation, found bool)
GetRedelegation returns a redelegation.
func (Keeper) GetRedelegationQueueTimeSlice ¶
func (k Keeper) GetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvvTriplets []types.DVVTriplet)
GetRedelegationQueueTimeSlice gets a specific redelegation queue timeslice. A timeslice is a slice of DVVTriplets corresponding to redelegations that expire at a certain time.
func (Keeper) GetRedelegations ¶
func (k Keeper) GetRedelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (redelegations []types.Redelegation)
GetRedelegations returns a given amount of all the delegator redelegations.
func (Keeper) GetRedelegationsFromSrcValidator ¶
func (k Keeper) GetRedelegationsFromSrcValidator(ctx sdk.Context, valAddr sdk.ValAddress) (reds []types.Redelegation)
GetRedelegationsFromSrcValidator returns all redelegations from a particular validator.
func (Keeper) GetTokenizeShareRecord ¶
func (Keeper) GetTokenizeShareRecordByDenom ¶
func (Keeper) GetTokenizeShareRecordsByOwner ¶
func (k Keeper) GetTokenizeShareRecordsByOwner(ctx sdk.Context, owner sdk.AccAddress) (tokenizeShareRecords []types.TokenizeShareRecord)
func (Keeper) GetTotalLiquidStakedTokens ¶
GetTotalLiquidStakedTokens returns the total outstanding tokens owned by a liquid staking provider Returns zero if the total liquid stake amount has not been initialized
func (Keeper) GetUBDQueueTimeSlice ¶
GetUBDQueueTimeSlice gets a specific unbonding queue timeslice. A timeslice is a slice of DVPairs corresponding to unbonding delegations that expire at a certain time.
func (Keeper) GetUnbondingDelegation ¶
func (k Keeper) GetUnbondingDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (ubd types.UnbondingDelegation, found bool)
GetUnbondingDelegation returns a unbonding delegation.
func (Keeper) GetUnbondingDelegations ¶
func (k Keeper) GetUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (unbondingDelegations []types.UnbondingDelegation)
GetUnbondingDelegations returns a given amount of all the delegator unbonding-delegations.
func (Keeper) GetUnbondingDelegationsFromValidator ¶
func (k Keeper) GetUnbondingDelegationsFromValidator(ctx sdk.Context, valAddr sdk.ValAddress) (ubds []types.UnbondingDelegation)
GetUnbondingDelegationsFromValidator returns all unbonding delegations from a particular validator.
func (Keeper) GetUnbondingValidators ¶
func (k Keeper) GetUnbondingValidators(ctx sdk.Context, endTime time.Time, endHeight int64) []string
GetUnbondingValidators returns a slice of mature validator addresses that complete their unbonding at a given time and height.
func (Keeper) GetValidator ¶
func (k Keeper) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator sdkstaking.Validator, found bool)
GetValidator gets a single validator
func (Keeper) GetValidatorByConsAddr ¶
func (k Keeper) GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (validator types.Validator, found bool)
get a single validator by consensus address
func (Keeper) GetValidatorDelegations ¶
func (k Keeper) GetValidatorDelegations(ctx sdk.Context, valAddr sdk.ValAddress) (delegations []types.Delegation)
GetValidatorDelegations returns all delegations to a specific validator. Useful for querier.
func (Keeper) GetValidatorSet ¶
func (k Keeper) GetValidatorSet() types.ValidatorSet
Returns self as it is both a validatorset and delegationset
func (Keeper) GetValidators ¶
return a given amount of all the validators
func (Keeper) GlobalLiquidStakingCap ¶
Global liquid staking cap across all liquid staking providers
func (Keeper) GlobalLiquidStakingCapEnabled ¶
Check whether the global liquid staking cap is enabled A cap less than 100% indicates that it is enabled
func (Keeper) HasMaxRedelegationEntries ¶
func (k Keeper) HasMaxRedelegationEntries(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorSrcAddr, validatorDstAddr sdk.ValAddress) bool
HasMaxRedelegationEntries checks if redelegation has maximum number of entries.
func (Keeper) HasMaxUnbondingDelegationEntries ¶
func (k Keeper) HasMaxUnbondingDelegationEntries(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) bool
HasMaxUnbondingDelegationEntries - check if unbonding delegation has maximum number of entries.
func (Keeper) HasReceivingRedelegation ¶
func (k Keeper) HasReceivingRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valDstAddr sdk.ValAddress) bool
HasReceivingRedelegation checks if validator is receiving a redelegation.
func (Keeper) HistoricalEntries ¶
HistoricalEntries = number of historical info entries to persist in store
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, 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 (Keeper) InsertRedelegationQueue ¶
func (k Keeper) InsertRedelegationQueue(ctx sdk.Context, red types.Redelegation, completionTime time.Time)
InsertRedelegationQueue insert an redelegation delegation to the appropriate timeslice in the redelegation queue.
func (Keeper) InsertUBDQueue ¶
func (k Keeper) InsertUBDQueue(ctx sdk.Context, ubd types.UnbondingDelegation, completionTime time.Time)
InsertUBDQueue inserts an unbonding delegation to the appropriate timeslice in the unbonding queue.
func (Keeper) InsertUnbondingValidatorQueue ¶
InsertUnbondingValidatorQueue inserts a given unbonding validator address into the unbonding validator queue for a given height and time.
func (Keeper) IterateAllDelegations ¶
func (k Keeper) IterateAllDelegations(ctx sdk.Context, cb func(delegation types.Delegation) (stop bool))
IterateAllDelegations iterates through all of the delegations.
func (Keeper) IterateBondedValidatorsByPower ¶
func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index int64, validator sdkstaking.ValidatorI) (stop bool))
iterate through the bonded validator set and perform the provided function
func (Keeper) IterateDelegations ¶
func (k Keeper) IterateDelegations(ctx sdk.Context, delAddr sdk.AccAddress, fn func(index int64, del sdkstaking.DelegationI) (stop bool), )
iterate through all of the delegations from a delegator
func (Keeper) IterateDelegatorDelegations ¶
func (k Keeper) IterateDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress, cb func(delegation types.Delegation) (stop bool))
IterateDelegatorDelegations iterates through one delegator's delegations.
func (Keeper) IterateDelegatorRedelegations ¶
func (k Keeper) IterateDelegatorRedelegations(ctx sdk.Context, delegator sdk.AccAddress, cb func(red types.Redelegation) (stop bool))
IterateDelegatorRedelegations iterates through one delegator's redelegations.
func (Keeper) IterateDelegatorUnbondingDelegations ¶
func (k Keeper) IterateDelegatorUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress, cb func(ubd types.UnbondingDelegation) (stop bool))
IterateDelegatorUnbondingDelegations iterates through a delegator's unbonding delegations.
func (Keeper) IterateHistoricalInfo ¶
IterateHistoricalInfo provides an interator over all stored HistoricalInfo
objects. For each HistoricalInfo object, cb will be called. If the cb returns
true, the iterator will close and stop.
func (Keeper) IterateLastValidatorPowers ¶
func (k Keeper) IterateLastValidatorPowers(ctx sdk.Context, handler func(operator sdk.ValAddress, power int64) (stop bool))
Iterate over last validator powers.
func (Keeper) IterateLastValidators ¶
func (k Keeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, validator sdkstaking.ValidatorI) (stop bool))
iterate through the active validator set and perform the provided function
func (Keeper) IterateRedelegations ¶
func (k Keeper) IterateRedelegations(ctx sdk.Context, fn func(index int64, red types.Redelegation) (stop bool))
IterateRedelegations iterates through all redelegations.
func (Keeper) IterateUnbondingDelegations ¶
func (k Keeper) IterateUnbondingDelegations(ctx sdk.Context, fn func(index int64, ubd types.UnbondingDelegation) (stop bool))
IterateUnbondingDelegations iterates through all of the unbonding delegations.
func (Keeper) IterateValidators ¶
func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validator sdkstaking.ValidatorI) (stop bool))
iterate through the validator set and perform the provided function
func (Keeper) Jail ¶
func (k Keeper) Jail(ctx sdk.Context, consAddr sdk.ConsAddress)
jail a validator
func (Keeper) LastValidatorsIterator ¶
returns an iterator for the consensus validators in the last block
func (Keeper) MaxEntries ¶
MaxEntries - Maximum number of simultaneous unbonding delegations or redelegations (per pair/trio)
func (Keeper) MaxValidators ¶
MaxValidators - Maximum number of validators
func (Keeper) MinCommissionRate ¶
MinCommissionRate - Minimum validator commission rate
func (Keeper) PowerReduction ¶
PowerReduction - is the amount of staking tokens required for 1 unit of consensus-engine power. Currently, this returns a global variable that the app developer can tweak. TODO: we might turn this into an on-chain param: https://github.com/cosmos/cosmos-sdk/issues/8365
func (Keeper) RedelegationQueueIterator ¶
RedelegationQueueIterator returns all the redelegation queue timeslices from time 0 until endTime.
func (Keeper) RemoveDelegation ¶
RemoveDelegation removes a delegation
func (Keeper) RemoveRedelegation ¶
func (k Keeper) RemoveRedelegation(ctx sdk.Context, red types.Redelegation)
RemoveRedelegation removes a redelegation object and associated index.
func (Keeper) RemoveUnbondingDelegation ¶
func (k Keeper) RemoveUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation)
RemoveUnbondingDelegation removes the unbonding delegation object and associated index.
func (Keeper) RemoveValidator ¶
func (k Keeper) RemoveValidator(ctx sdk.Context, address sdk.ValAddress)
remove the validator record and associated indexes except for the bonded validator index which is only handled in ApplyAndReturnTendermintUpdates TODO, this function panics, and it's not good.
func (Keeper) RemoveValidatorTokens ¶
func (k Keeper) RemoveValidatorTokens(ctx sdk.Context, validator types.Validator, tokensToRemove math.Int, ) types.Validator
Update the tokens of an existing validator, update the validators power index key
func (Keeper) RemoveValidatorTokensAndShares ¶
func (k Keeper) RemoveValidatorTokensAndShares(ctx sdk.Context, validator types.Validator, sharesToRemove sdk.Dec, ) (valOut types.Validator, removedTokens math.Int)
Update the tokens of an existing validator, update the validators power index key
func (Keeper) SafelyDecreaseValidatorBond ¶
func (k Keeper) SafelyDecreaseValidatorBond(ctx sdk.Context, validator types.Validator, shares sdk.Dec) error
SafelyDecreaseValidatorBond decrements the total validator's self bond so long as it will not cause the current delegations to exceed the threshold set by validator bond factor
func (Keeper) SafelyIncreaseTotalLiquidStakedTokens ¶
SafelyIncreaseTotalLiquidStakedTokens increments the total liquid staked tokens if the global cap is enabled and is not surpassed by this delegation
func (Keeper) SafelyIncreaseValidatorTotalLiquidShares ¶
func (k Keeper) SafelyIncreaseValidatorTotalLiquidShares(ctx sdk.Context, validator types.Validator, shares sdk.Dec) error
SafelyIncreaseValidatorTotalLiquidShares increments the total liquid shares on a validator if the validator bond factor is enabled and is not surpassed by this delegation
func (Keeper) SetDelegation ¶
func (k Keeper) SetDelegation(ctx sdk.Context, delegation types.Delegation)
SetDelegation sets a delegation.
func (Keeper) SetHistoricalInfo ¶
SetHistoricalInfo sets the historical info at a given height
func (*Keeper) SetHooks ¶
func (k *Keeper) SetHooks(sh types.StakingHooks) *Keeper
Set the validator hooks
func (Keeper) SetLastTokenizeShareRecordId ¶
func (Keeper) SetLastTotalPower ¶
Set the last total validator power.
func (Keeper) SetLastValidatorPower ¶
Set the last validator power.
func (Keeper) SetNewValidatorByPowerIndex ¶
validator index
func (Keeper) SetRedelegation ¶
func (k Keeper) SetRedelegation(ctx sdk.Context, red types.Redelegation)
SetRedelegation set a redelegation and associated index.
func (Keeper) SetRedelegationEntry ¶
func (k Keeper) SetRedelegationEntry(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorSrcAddr, validatorDstAddr sdk.ValAddress, creationHeight int64, minTime time.Time, balance math.Int, sharesSrc, sharesDst sdk.Dec, ) types.Redelegation
SetRedelegationEntry adds an entry to the unbonding delegation at the given addresses. It creates the unbonding delegation if it does not exist.
func (Keeper) SetRedelegationQueueTimeSlice ¶
func (k Keeper) SetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DVVTriplet)
SetRedelegationQueueTimeSlice sets a specific redelegation queue timeslice.
func (Keeper) SetTotalLiquidStakedTokens ¶
SetTotalLiquidStakedTokens stores the total outstanding tokens owned by a liquid staking provider
func (Keeper) SetUBDQueueTimeSlice ¶
SetUBDQueueTimeSlice sets a specific unbonding queue timeslice.
func (Keeper) SetUnbondingDelegation ¶
func (k Keeper) SetUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation)
SetUnbondingDelegation sets the unbonding delegation and associated index.
func (Keeper) SetUnbondingDelegationEntry ¶
func (k Keeper) SetUnbondingDelegationEntry( ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, creationHeight int64, minTime time.Time, balance math.Int, ) types.UnbondingDelegation
SetUnbondingDelegationEntry adds an entry to the unbonding delegation at the given addresses. It creates the unbonding delegation if it does not exist.
func (Keeper) SetUnbondingValidatorsQueue ¶
func (k Keeper) SetUnbondingValidatorsQueue(ctx sdk.Context, endTime time.Time, endHeight int64, addrs []string)
SetUnbondingValidatorsQueue sets a given slice of validator addresses into the unbonding validator queue by a given height and time.
func (Keeper) SetValidator ¶
set the main record holding validator details
func (Keeper) SetValidatorByConsAddr ¶
validator index
func (Keeper) SetValidatorByPowerIndex ¶
validator index
func (Keeper) Slash ¶
func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeight int64, power int64, slashFactor sdk.Dec) math.Int
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 (Keeper) SlashRedelegation ¶
func (k Keeper) SlashRedelegation(ctx sdk.Context, srcValidator types.Validator, redelegation types.Redelegation, infractionHeight int64, slashFactor sdk.Dec, ) (totalSlashAmount math.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 (Keeper) SlashUnbondingDelegation ¶
func (k Keeper) SlashUnbondingDelegation(ctx sdk.Context, unbondingDelegation types.UnbondingDelegation, infractionHeight int64, slashFactor sdk.Dec, ) (totalSlashAmount math.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 (Keeper) StakingTokenSupply ¶
StakingTokenSupply staking tokens from the total supply
func (Keeper) TokensFromConsensusPower ¶
TokensFromConsensusPower - convert input power to tokens
func (Keeper) TokensToConsensusPower ¶
TokensToConsensusPower - convert input tokens to potential consensus-engine power
func (Keeper) TotalBondedTokens ¶
TotalBondedTokens total staking tokens supply which is bonded
func (Keeper) TrackHistoricalInfo ¶
TrackHistoricalInfo saves the latest historical-info and deletes the oldest heights that are below pruning height
func (Keeper) UBDQueueIterator ¶
UBDQueueIterator returns all the unbonding queue timeslices from time 0 until endTime.
func (Keeper) Unbond ¶
func (k Keeper) Unbond( ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, shares sdk.Dec, ) (amount math.Int, err error)
Unbond unbonds a particular delegation and perform associated store operations.
func (Keeper) UnbondAllMatureValidators ¶
UnbondAllMatureValidators unbonds all the mature unbonding validators that have finished their unbonding period.
func (Keeper) UnbondingTime ¶
UnbondingTime
func (Keeper) UnbondingToUnbonded ¶
UnbondingToUnbonded switches a validator from unbonding state to unbonded state
func (Keeper) Undelegate ¶
func (k Keeper) Undelegate( ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, sharesAmount sdk.Dec, ) (time.Time, error)
Undelegate unbonds an amount of delegator shares from a given validator. It will verify that the unbonding entries between the delegator and validator are not exceeded and unbond the staked tokens (based on shares) by creating an unbonding object and inserting it into the unbonding queue which will be processed during the staking EndBlocker.
func (Keeper) Unjail ¶
func (k Keeper) Unjail(ctx sdk.Context, consAddr sdk.ConsAddress)
unjail a validator
func (Keeper) UpdateValidatorCommission ¶
func (k Keeper) UpdateValidatorCommission(ctx sdk.Context, validator types.Validator, newRate sdk.Dec, ) (types.Commission, error)
UpdateValidatorCommission attempts to update a validator's commission rate. An error is returned if the new commission rate is invalid.
func (Keeper) ValidateUnbondAmount ¶
func (k Keeper) ValidateUnbondAmount( ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt math.Int, ) (shares sdk.Dec, err error)
ValidateUnbondAmount validates that a given unbond or redelegation amount is valied based on upon the converted shares. If the amount is valid, the total amount of respective shares is returned, otherwise an error is returned.
func (Keeper) Validator ¶
func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) sdkstaking.ValidatorI
Validator gets the Validator interface for a particular address
func (Keeper) ValidatorBondFactor ¶
ValidatorBondFactor - validator bond factor for all validators
func (Keeper) ValidatorBondFactorEnabled ¶
Check whether the validator bond factor is enabled A non-negative factor indicates that it is enabled
func (Keeper) ValidatorByConsAddr ¶
func (k Keeper) ValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) sdkstaking.ValidatorI
ValidatorByConsAddr gets the validator interface for a particular pubkey
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func (Migrator) Migrate1to2 ¶
Migrate1to2 migrates from version 1 to 2.
type Querier ¶
type Querier struct {
Keeper
}
Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper
func (Querier) AllTokenizeShareRecords ¶
func (k Querier) AllTokenizeShareRecords(c context.Context, req *types.QueryAllTokenizeShareRecordsRequest) (*types.QueryAllTokenizeShareRecordsResponse, error)
Query for all tokenize share records
func (Querier) Delegation ¶
func (k Querier) Delegation(c context.Context, req *types.QueryDelegationRequest) (*types.QueryDelegationResponse, error)
Delegation queries delegate info for given validator delegator pair
func (Querier) DelegatorDelegations ¶
func (k Querier) DelegatorDelegations(c context.Context, req *types.QueryDelegatorDelegationsRequest) (*types.QueryDelegatorDelegationsResponse, error)
DelegatorDelegations queries all delegations of a give delegator address
func (Querier) DelegatorUnbondingDelegations ¶
func (k Querier) DelegatorUnbondingDelegations(c context.Context, req *types.QueryDelegatorUnbondingDelegationsRequest) (*types.QueryDelegatorUnbondingDelegationsResponse, error)
DelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address
func (Querier) DelegatorValidator ¶
func (k Querier) DelegatorValidator(c context.Context, req *types.QueryDelegatorValidatorRequest) (*types.QueryDelegatorValidatorResponse, error)
DelegatorValidator queries validator info for given delegator validator pair
func (Querier) DelegatorValidators ¶
func (k Querier) DelegatorValidators(c context.Context, req *types.QueryDelegatorValidatorsRequest) (*types.QueryDelegatorValidatorsResponse, error)
DelegatorValidators queries all validators info for given delegator address
func (Querier) HistoricalInfo ¶
func (k Querier) HistoricalInfo(c context.Context, req *types.QueryHistoricalInfoRequest) (*types.QueryHistoricalInfoResponse, error)
HistoricalInfo queries the historical info for given height
func (Querier) LastTokenizeShareRecordId ¶
func (k Querier) LastTokenizeShareRecordId(c context.Context, req *types.QueryLastTokenizeShareRecordIdRequest) (*types.QueryLastTokenizeShareRecordIdResponse, error)
Query for last tokenize share record id
func (Querier) Params ¶
func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries the staking parameters
func (Querier) Pool ¶
func (k Querier) Pool(c context.Context, _ *types.QueryPoolRequest) (*types.QueryPoolResponse, error)
Pool queries the pool info
func (Querier) Redelegations ¶
func (k Querier) Redelegations(c context.Context, req *types.QueryRedelegationsRequest) (*types.QueryRedelegationsResponse, error)
Redelegations queries redelegations of given address
func (Querier) TokenizeShareRecordByDenom ¶
func (k Querier) TokenizeShareRecordByDenom(c context.Context, req *types.QueryTokenizeShareRecordByDenomRequest) (*types.QueryTokenizeShareRecordByDenomResponse, error)
Query for individual tokenize share record information by share denom
func (Querier) TokenizeShareRecordById ¶
func (k Querier) TokenizeShareRecordById(c context.Context, req *types.QueryTokenizeShareRecordByIdRequest) (*types.QueryTokenizeShareRecordByIdResponse, error)
Query for individual tokenize share record information by share by id
func (Querier) TokenizeShareRecordsOwned ¶
func (k Querier) TokenizeShareRecordsOwned(c context.Context, req *types.QueryTokenizeShareRecordsOwnedRequest) (*types.QueryTokenizeShareRecordsOwnedResponse, error)
Query tokenize share records by address
func (Querier) TotalTokenizeSharedAssets ¶
func (k Querier) TotalTokenizeSharedAssets(c context.Context, req *types.QueryTotalTokenizeSharedAssetsRequest) (*types.QueryTotalTokenizeSharedAssetsResponse, error)
Query for total tokenized staked assets
func (Querier) UnbondingDelegation ¶
func (k Querier) UnbondingDelegation(c context.Context, req *types.QueryUnbondingDelegationRequest) (*types.QueryUnbondingDelegationResponse, error)
UnbondingDelegation queries unbonding info for give validator delegator pair
func (Querier) Validator ¶
func (k Querier) Validator(c context.Context, req *types.QueryValidatorRequest) (*types.QueryValidatorResponse, error)
Validator queries validator info for given validator address
func (Querier) ValidatorDelegations ¶
func (k Querier) ValidatorDelegations(c context.Context, req *types.QueryValidatorDelegationsRequest) (*types.QueryValidatorDelegationsResponse, error)
ValidatorDelegations queries delegate info for given validator
func (Querier) ValidatorUnbondingDelegations ¶
func (k Querier) ValidatorUnbondingDelegations(c context.Context, req *types.QueryValidatorUnbondingDelegationsRequest) (*types.QueryValidatorUnbondingDelegationsResponse, error)
ValidatorUnbondingDelegations queries unbonding delegations of a validator
func (Querier) Validators ¶
func (k Querier) Validators(c context.Context, req *types.QueryValidatorsRequest) (*types.QueryValidatorsResponse, error)
Validators queries all validators that match the given status
type SdkMsgHandler ¶
type SdkMsgHandler interface { sdkstaking.MsgServer }
func NewSdkMsgHandlerWrapper ¶
func NewSdkMsgHandlerWrapper(handler types.MsgServer) SdkMsgHandler
NewSdkMsgHandlerWrapper returns SdkMsgHandler that implements MsgServer for vanilla sdk staking keeper handler, allowing us to route legacy messages to a forked keeper.
Source Files ¶
- alias_functions.go
- delegation.go
- genesis.go
- grpc_query.go
- historical_info.go
- hooks.go
- invariants.go
- keeper.go
- liquid_stake.go
- migrations.go
- msg_server.go
- params.go
- pool.go
- power_reduction.go
- querier.go
- query_utils.go
- sdk_handler.go
- slash.go
- test_common.go
- tokenize_share_record.go
- val_state_change.go
- validator.go