Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AddAmountToDelegationRewards(ctx sdk.Context, stakerAddress string, amount uint64)
- func (k Keeper) DoesDelegationDataExist(ctx sdk.Context, stakerAddress string) bool
- func (k Keeper) DoesDelegatorExist(ctx sdk.Context, stakerAddress string, delegatorAddress string) bool
- func (k Keeper) GetAllDelegationData(ctx sdk.Context) (list []types.DelegationData)
- func (k Keeper) GetAllDelegationEntries(ctx sdk.Context) (list []types.DelegationEntry)
- func (k Keeper) GetAllDelegationSlashEntries(ctx sdk.Context) (list []types.DelegationSlash)
- func (k Keeper) GetAllDelegationSlashesBetween(ctx sdk.Context, staker string, start uint64, end uint64) (list []types.DelegationSlash)
- func (k Keeper) GetAllDelegators(ctx sdk.Context) (list []types.Delegator)
- func (k Keeper) GetAllRedelegationCooldownEntries(ctx sdk.Context) (list []types.RedelegationCooldown)
- func (k Keeper) GetAllUnbondingDelegationQueueEntries(ctx sdk.Context) (list []types.UndelegationQueueEntry)
- func (k Keeper) GetAllUnbondingDelegationQueueEntriesOfDelegator(ctx sdk.Context, address string) (list []types.UndelegationQueueEntry)
- func (k Keeper) GetDelegationAmount(ctx sdk.Context, staker string) uint64
- func (k Keeper) GetDelegationAmountOfDelegator(ctx sdk.Context, stakerAddress string, delegatorAddress string) uint64
- func (k Keeper) GetDelegationData(ctx sdk.Context, stakerAddress string) (val types.DelegationData, found bool)
- func (k Keeper) GetDelegationEntry(ctx sdk.Context, stakerAddress string, kIndex uint64) (val types.DelegationEntry, found bool)
- func (k Keeper) GetDelegationOfPool(ctx sdk.Context, poolId uint64) uint64
- func (k Keeper) GetDelegationSlashEntry(ctx sdk.Context, stakerAddress string, kIndex uint64) (val types.DelegationSlash, found bool)
- func (k Keeper) GetDelegator(ctx sdk.Context, stakerAddress string, delegatorAddress string) (val types.Delegator, found bool)
- func (k Keeper) GetOutstandingRewards(ctx sdk.Context, staker string, delegator string) uint64
- func (k Keeper) GetPaginatedActiveStakersByDelegation(ctx sdk.Context, pagination *query.PageRequest, ...) (*query.PageResponse, error)
- func (k Keeper) GetPaginatedActiveStakersByPoolCountAndDelegation(ctx sdk.Context, pagination *query.PageRequest) ([]string, *query.PageResponse, error)
- func (k Keeper) GetPaginatedInactiveStakersByDelegation(ctx sdk.Context, pagination *query.PageRequest, ...) (*query.PageResponse, error)
- func (k Keeper) GetPaginatedStakersByDelegation(ctx sdk.Context, pagination *query.PageRequest, ...) (*query.PageResponse, error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetQueueState(ctx sdk.Context) (state types.QueueState)
- func (k Keeper) GetRedelegationCooldown(ctx sdk.Context) (res uint64)
- func (k Keeper) GetRedelegationCooldownEntries(ctx sdk.Context, delegatorAddress string) (creationDates []uint64)
- func (k Keeper) GetRedelegationMaxAmount(ctx sdk.Context) (res uint64)
- func (k Keeper) GetStakersByDelegator(ctx sdk.Context, delegator string) (list []string)
- func (k Keeper) GetTimeoutSlash(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) GetUnbondingDelegationTime(ctx sdk.Context) (res uint64)
- func (k Keeper) GetUndelegationQueueEntry(ctx sdk.Context, index uint64) (val types.UndelegationQueueEntry, found bool)
- func (k Keeper) GetUploadSlash(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) GetVoteSlash(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) InitMemStore(gasCtx sdk.Context)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) PayoutRewards(ctx sdk.Context, staker string, amount uint64, payerModuleName string) error
- func (k Keeper) ProcessDelegatorUnbondingQueue(ctx sdk.Context)
- func (k Keeper) RemoveDelegationData(ctx sdk.Context, stakerAddress string)
- func (k Keeper) RemoveDelegationEntry(ctx sdk.Context, stakerAddress string, kIndex uint64)
- func (k Keeper) RemoveDelegationSlashEntry(ctx sdk.Context, stakerAddress string, kIndex uint64)
- func (k Keeper) RemoveDelegator(ctx sdk.Context, stakerAddress string, delegatorAddress string)
- func (k Keeper) RemoveRedelegationCooldown(ctx sdk.Context, delegatorAddress string, block uint64)
- func (k Keeper) RemoveStakerIndex(ctx sdk.Context, staker string)
- func (k Keeper) RemoveUndelegationQueueEntry(ctx sdk.Context, undelegationQueueEntry *types.UndelegationQueueEntry)
- func (k Keeper) SetDelegationData(ctx sdk.Context, delegationData types.DelegationData)
- func (k Keeper) SetDelegationEntry(ctx sdk.Context, delegationEntries types.DelegationEntry)
- func (k Keeper) SetDelegationSlashEntry(ctx sdk.Context, slashEntry types.DelegationSlash)
- func (k Keeper) SetDelegator(ctx sdk.Context, delegator types.Delegator)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetQueueState(ctx sdk.Context, state types.QueueState)
- func (k Keeper) SetRedelegationCooldown(ctx sdk.Context, redelegationCooldown types.RedelegationCooldown)
- func (k Keeper) SetStakerIndex(ctx sdk.Context, staker string)
- func (k Keeper) SetUndelegationQueueEntry(ctx sdk.Context, undelegationQueueEntry types.UndelegationQueueEntry)
- func (k Keeper) SlashDelegators(ctx sdk.Context, poolId uint64, staker string, slashType types.SlashType)
- func (k Keeper) StartUnbondingDelegator(ctx sdk.Context, staker string, delegatorAddress string, amount uint64)
- func (k Keeper) StoreKey() storetypes.StoreKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, memKey storetypes.StoreKey, authority string, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, distrkeeper types.DistrKeeper, poolKeeper types.PoolKeeper, upgradeKeeper types.UpgradeKeeper, stakersKeeper types.StakersKeeper, ) *Keeper
func (Keeper) AddAmountToDelegationRewards ¶
AddAmountToDelegationRewards adds the specified amount to the current delegationData object. This is needed by the F1-algorithm to calculate to outstanding rewards
func (Keeper) DoesDelegationDataExist ¶
DoesDelegationDataExist check if the staker with `stakerAddress` has a delegation data entry. This is the case if the staker as at least one delegator.
func (Keeper) DoesDelegatorExist ¶
func (k Keeper) DoesDelegatorExist( ctx sdk.Context, stakerAddress string, delegatorAddress string, ) bool
DoesDelegatorExist checks if the key exists in the KV-store
func (Keeper) GetAllDelegationData ¶
func (k Keeper) GetAllDelegationData(ctx sdk.Context) (list []types.DelegationData)
GetAllDelegationData returns all delegationData entries
func (Keeper) GetAllDelegationEntries ¶
func (k Keeper) GetAllDelegationEntries(ctx sdk.Context) (list []types.DelegationEntry)
GetAllDelegationEntries returns all delegationEntries (of all stakers)
func (Keeper) GetAllDelegationSlashEntries ¶
func (k Keeper) GetAllDelegationSlashEntries(ctx sdk.Context) (list []types.DelegationSlash)
GetAllDelegationSlashEntries returns all delegation slash entries (of all stakers)
func (Keeper) GetAllDelegationSlashesBetween ¶
func (k Keeper) GetAllDelegationSlashesBetween(ctx sdk.Context, staker string, start uint64, end uint64) (list []types.DelegationSlash)
GetAllDelegationSlashesBetween returns all Slashes that happened between the given periods `start` and `end` are both inclusive.
func (Keeper) GetAllDelegators ¶
GetAllDelegators returns all delegators (of all stakers)
func (Keeper) GetAllRedelegationCooldownEntries ¶
func (k Keeper) GetAllRedelegationCooldownEntries(ctx sdk.Context) (list []types.RedelegationCooldown)
GetAllRedelegationCooldownEntries ...
func (Keeper) GetAllUnbondingDelegationQueueEntries ¶
func (k Keeper) GetAllUnbondingDelegationQueueEntries(ctx sdk.Context) (list []types.UndelegationQueueEntry)
GetAllUnbondingDelegationQueueEntries returns all delegator unbondings
func (Keeper) GetAllUnbondingDelegationQueueEntriesOfDelegator ¶
func (k Keeper) GetAllUnbondingDelegationQueueEntriesOfDelegator(ctx sdk.Context, address string) (list []types.UndelegationQueueEntry)
GetAllUnbondingDelegationQueueEntriesOfDelegator returns all delegator unbondings of the given address
func (Keeper) GetDelegationAmount ¶
GetDelegationAmount returns the sum of all delegations for a specific staker. If the staker does not exist, it returns zero as the staker has zero delegations
func (Keeper) GetDelegationAmountOfDelegator ¶
func (k Keeper) GetDelegationAmountOfDelegator(ctx sdk.Context, stakerAddress string, delegatorAddress string) uint64
GetDelegationAmountOfDelegator returns the amount of how many $KYVE `delegatorAddress` has delegated to `stakerAddress`. If one of the addresses does not exist, it returns zero.
func (Keeper) GetDelegationData ¶
func (k Keeper) GetDelegationData(ctx sdk.Context, stakerAddress string) (val types.DelegationData, found bool)
GetDelegationData returns a delegationData entry for a specific staker with `stakerAddress`
func (Keeper) GetDelegationEntry ¶
func (k Keeper) GetDelegationEntry( ctx sdk.Context, stakerAddress string, kIndex uint64, ) (val types.DelegationEntry, found bool)
GetDelegationEntry returns a delegationEntry from its index
func (Keeper) GetDelegationOfPool ¶
GetDelegationOfPool returns the amount of how many $KYVE users have delegated to stakers that are participating in the given pool
func (Keeper) GetDelegationSlashEntry ¶
func (k Keeper) GetDelegationSlashEntry( ctx sdk.Context, stakerAddress string, kIndex uint64, ) (val types.DelegationSlash, found bool)
GetDelegationSlashEntry returns a DelegationSlash for the given staker and index.
func (Keeper) GetDelegator ¶
func (k Keeper) GetDelegator( ctx sdk.Context, stakerAddress string, delegatorAddress string, ) (val types.Delegator, found bool)
GetDelegator returns a delegator from its index
func (Keeper) GetOutstandingRewards ¶
GetOutstandingRewards calculates the current rewards a delegator has collected for the given staker.
func (Keeper) GetPaginatedActiveStakersByDelegation ¶
func (k Keeper) GetPaginatedActiveStakersByDelegation(ctx sdk.Context, pagination *query.PageRequest, accumulator func(staker string, accumulate bool) bool) (*query.PageResponse, error)
GetPaginatedActiveStakersByDelegation returns all active stakers sorted by its current total delegation. It supports the cosmos query.PageRequest pagination.
func (Keeper) GetPaginatedActiveStakersByPoolCountAndDelegation ¶
func (k Keeper) GetPaginatedActiveStakersByPoolCountAndDelegation(ctx sdk.Context, pagination *query.PageRequest) ([]string, *query.PageResponse, error)
GetPaginatedActiveStakersByPoolCountAndDelegation returns all active stakers sorted by the amount of pools they are participating. If the poolCount is equal they are sorted by current total delegation. It supports the cosmos query.PageRequest pagination.
func (Keeper) GetPaginatedInactiveStakersByDelegation ¶
func (k Keeper) GetPaginatedInactiveStakersByDelegation(ctx sdk.Context, pagination *query.PageRequest, accumulator func(staker string, accumulate bool) bool) (*query.PageResponse, error)
GetPaginatedInactiveStakersByDelegation returns all inactive stakers sorted by its current total delegation. It supports the cosmos query.PageRequest pagination.
func (Keeper) GetPaginatedStakersByDelegation ¶
func (k Keeper) GetPaginatedStakersByDelegation(ctx sdk.Context, pagination *query.PageRequest, accumulator func(staker string, accumulate bool) bool) (*query.PageResponse, error)
GetPaginatedStakersByDelegation returns all stakers (active and inactive) sorted by its current total delegation. It supports the cosmos query.PageRequest pagination.
func (Keeper) GetQueueState ¶
func (k Keeper) GetQueueState(ctx sdk.Context) (state types.QueueState)
GetQueueState returns the state for the undelegation queue
func (Keeper) GetRedelegationCooldown ¶
GetRedelegationCooldown returns the RedelegationCooldown param
func (Keeper) GetRedelegationCooldownEntries ¶
func (k Keeper) GetRedelegationCooldownEntries(ctx sdk.Context, delegatorAddress string) (creationDates []uint64)
GetRedelegationCooldownEntries ...
func (Keeper) GetRedelegationMaxAmount ¶
GetRedelegationMaxAmount returns the RedelegationMaxAmount param
func (Keeper) GetStakersByDelegator ¶
func (Keeper) GetTimeoutSlash ¶
GetTimeoutSlash returns the TimeoutSlash param
func (Keeper) GetUnbondingDelegationTime ¶
GetUnbondingDelegationTime returns the UnbondingDelegationTime param
func (Keeper) GetUndelegationQueueEntry ¶
func (k Keeper) GetUndelegationQueueEntry(ctx sdk.Context, index uint64) (val types.UndelegationQueueEntry, found bool)
GetUndelegationQueueEntry ...
func (Keeper) GetUploadSlash ¶
GetUploadSlash returns the UploadSlash param
func (Keeper) GetVoteSlash ¶
GetVoteSlash returns the VoteSlash param
func (Keeper) InitMemStore ¶
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) PayoutRewards ¶
func (k Keeper) PayoutRewards(ctx sdk.Context, staker string, amount uint64, payerModuleName string) error
PayoutRewards transfers `amount` $nKYVE from the `payerModuleName`-module to the delegation module. It then awards these tokens internally to all delegators of staker `staker`. Delegators can then receive these rewards if they call the `withdraw`-transaction. If the staker has no delegators or the module to module transfer fails the method fails and returns the error.
func (Keeper) ProcessDelegatorUnbondingQueue ¶
ProcessDelegatorUnbondingQueue is called in the end block and checks the queue for entries that have surpassed the unbonding time. If the unbonding time is reached, the actual unbonding is performed and the entry is removed from the queue.
func (Keeper) RemoveDelegationData ¶
RemoveDelegationData removes a delegationData entry from the pool
func (Keeper) RemoveDelegationEntry ¶
RemoveDelegationEntry removes a delegationEntry for the given staker with the given index from the store
func (Keeper) RemoveDelegationSlashEntry ¶
RemoveDelegationSlashEntry removes an entry for a given staker and index
func (Keeper) RemoveDelegator ¶
RemoveDelegator removes a delegator from the store
func (Keeper) RemoveRedelegationCooldown ¶
RemoveRedelegationCooldown ...
func (Keeper) RemoveStakerIndex ¶
RemoveStakerIndex deletes and Index-entry which sorts all stakers (active and passive) by its total delegation
func (Keeper) RemoveUndelegationQueueEntry ¶
func (k Keeper) RemoveUndelegationQueueEntry(ctx sdk.Context, undelegationQueueEntry *types.UndelegationQueueEntry)
RemoveUndelegationQueueEntry ...
func (Keeper) SetDelegationData ¶
func (k Keeper) SetDelegationData(ctx sdk.Context, delegationData types.DelegationData)
SetDelegationData set a specific delegationPoolData in the store from its index
func (Keeper) SetDelegationEntry ¶
func (k Keeper) SetDelegationEntry(ctx sdk.Context, delegationEntries types.DelegationEntry)
SetDelegationEntry set a specific delegationEntry in the store for the staker and a given index
func (Keeper) SetDelegationSlashEntry ¶
func (k Keeper) SetDelegationSlashEntry(ctx sdk.Context, slashEntry types.DelegationSlash)
SetDelegationSlashEntry for the affected staker with the index of the period the slash is starting.
func (Keeper) SetDelegator ¶
SetDelegator set a specific delegator in the store from its index
func (Keeper) SetQueueState ¶
func (k Keeper) SetQueueState(ctx sdk.Context, state types.QueueState)
SetQueueState saves the undelegation queue state
func (Keeper) SetRedelegationCooldown ¶
func (k Keeper) SetRedelegationCooldown(ctx sdk.Context, redelegationCooldown types.RedelegationCooldown)
SetRedelegationCooldown ...
func (Keeper) SetStakerIndex ¶
SetStakerIndex sets and Index-entry which sorts all stakers (active and passive) by its total delegation
func (Keeper) SetUndelegationQueueEntry ¶
func (k Keeper) SetUndelegationQueueEntry(ctx sdk.Context, undelegationQueueEntry types.UndelegationQueueEntry)
SetUndelegationQueueEntry ...
func (Keeper) SlashDelegators ¶
func (k Keeper) SlashDelegators(ctx sdk.Context, poolId uint64, staker string, slashType types.SlashType)
SlashDelegators reduces the delegation of all delegators of `staker` by fraction and transfers the amount to the Treasury.
func (Keeper) StartUnbondingDelegator ¶
func (k Keeper) StartUnbondingDelegator(ctx sdk.Context, staker string, delegatorAddress string, amount uint64)
StartUnbondingDelegator creates a queue entry to schedule the unbonding. After the DelegationTime is reached the actual unbonding will be performed The actual unbonding is then performed by `func ProcessDelegatorUnbondingQueue(...)`
func (Keeper) StoreKey ¶
func (k Keeper) StoreKey() storetypes.StoreKey
Source Files ¶
- exported_functions.go
- getters_delegation_data.go
- getters_delegation_entries.go
- getters_delegation_slash.go
- getters_delegator.go
- getters_index_stakers.go
- getters_params.go
- getters_redelegation.go
- getters_undelegation.go
- grpc_query.go
- keeper.go
- logic_delegation.go
- logic_f1distribution.go
- logic_redelegation.go
- logic_unbonding.go
- msg_server.go
- msg_server_delegate.go
- msg_server_redelegate.go
- msg_server_undelegate.go
- msg_server_update_params.go
- msg_server_withdraw_rewards.go