Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AggregateRewards(ctx sdk.Context, provider, chainid string, adjustment sdk.Dec, ...)
- func (k Keeper) AllocationPoolMonthsLeft(ctx sdk.Context) int64
- func (k Keeper) BeginBlock(ctx sdk.Context)
- func (k Keeper) BlockReward(goCtx context.Context, req *types.QueryBlockRewardRequest) (*types.QueryBlockRewardResponse, error)
- func (k Keeper) BlocksToNextTimerExpiry(ctx sdk.Context) int64
- func (k Keeper) BondedTargetFactor(ctx sdk.Context) cosmosMath.LegacyDec
- func (k Keeper) BurnPoolTokens(ctx sdk.Context, pool types.Pool, amt math.Int) error
- func (k Keeper) CalculateContributionPercentages(ctx sdk.Context, reward math.Int, senderModule string) (validatorsParticipation math.LegacyDec, communityParticipation math.LegacyDec, ...)
- func (k Keeper) ContributeToValidatorsAndCommunityPool(ctx sdk.Context, reward math.Int, senderModule string) (updatedReward math.Int, err error)
- func (k Keeper) DistributeBlockReward(ctx sdk.Context)
- func (k Keeper) ExportRewardsRefillTS(ctx sdk.Context) timerstoretypes.GenesisState
- func (k Keeper) FundCommunityPoolFromModule(ctx sdk.Context, amount math.Int, senderModule string) error
- func (k Keeper) GetAllBasePay(ctx sdk.Context) (list []types.BasePayGenesis)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) InitRewardsRefillTS(ctx sdk.Context, gs timerstoretypes.GenesisState)
- func (k Keeper) LeftoverBurnRate(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) LowFactor(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) MaxBondedTarget(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) MaxRewardBoost(ctx sdk.Context) (res uint64)
- func (k Keeper) MinBondedTarget(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) Pools(goCtx context.Context, req *types.QueryPoolsRequest) (*types.QueryPoolsResponse, error)
- func (k Keeper) RefillRewardsPools(ctx sdk.Context, _ []byte, data []byte)
- func (k Keeper) SetAllBasePay(ctx sdk.Context, list []types.BasePayGenesis)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) TimeToNextTimerExpiry(ctx sdk.Context) int64
- func (k Keeper) TotalPoolTokens(ctx sdk.Context, pool types.Pool) math.Int
- func (k Keeper) ValidatorsSubscriptionParticipation(ctx sdk.Context) (res sdk.Dec)
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, memKey storetypes.StoreKey, ps paramtypes.Subspace, bankKeeper types.BankKeeper, accountKeeper types.AccountKeeper, specKeeper types.SpecKeeper, epochStorageKeeper types.EpochstorageKeeper, downtimeKeeper types.DowntimeKeeper, stakingKeeper types.StakingKeeper, dualstakingKeeper types.DualStakingKeeper, distributionKeeper types.DistributionKeeper, feeCollectorName string, timerStoreKeeper types.TimerStoreKeeper, ) *Keeper
func (Keeper) AggregateRewards ¶
func (Keeper) AllocationPoolMonthsLeft ¶
AllocationPoolMonthsLeft returns the amount of months the allocation pools have left before all their are depleted
func (Keeper) BeginBlock ¶
redeclaring BeginBlock for testing (this is not called outside of unit tests)
func (Keeper) BlockReward ¶
func (k Keeper) BlockReward(goCtx context.Context, req *types.QueryBlockRewardRequest) (*types.QueryBlockRewardResponse, error)
func (Keeper) BlocksToNextTimerExpiry ¶
BlocksToNextTimerExpiry extracts the timer's expiry block from the timer's subkey and returns the amount of blocks remaining (according to the current block height) the calculated blocks are multiplied with a slack factor (for error margin)
func (Keeper) BondedTargetFactor ¶
func (k Keeper) BondedTargetFactor(ctx sdk.Context) cosmosMath.LegacyDec
BondedTargetFactor calculates the bonded target factor which is used to calculate the validators block rewards
func (Keeper) BurnPoolTokens ¶
BurnPoolTokens removes coins from a pool module account
func (Keeper) CalculateContributionPercentages ¶
func (k Keeper) CalculateContributionPercentages(ctx sdk.Context, reward math.Int, senderModule string) (validatorsParticipation math.LegacyDec, communityParticipation math.LegacyDec, err error)
CalculateContributionPercentages calculates the providers' rewards participation to the validators and community pool
func (Keeper) ContributeToValidatorsAndCommunityPool ¶
func (k Keeper) ContributeToValidatorsAndCommunityPool(ctx sdk.Context, reward math.Int, senderModule string) (updatedReward math.Int, err error)
ContributeToValidatorsAndCommunityPool transfers some of the providers' rewards to the validators and community pool the function return the updated reward after the participation deduction
func (Keeper) DistributeBlockReward ¶
func (Keeper) ExportRewardsRefillTS ¶
func (k Keeper) ExportRewardsRefillTS(ctx sdk.Context) timerstoretypes.GenesisState
ExportRewardsRefillTS exports refill pools timers data (for genesis)
func (Keeper) FundCommunityPoolFromModule ¶
func (Keeper) GetAllBasePay ¶
func (k Keeper) GetAllBasePay(ctx sdk.Context) (list []types.BasePayGenesis)
GetAllBasePay returns all BasePay
func (Keeper) InitRewardsRefillTS ¶
func (k Keeper) InitRewardsRefillTS(ctx sdk.Context, gs timerstoretypes.GenesisState)
InitRewardsRefillTS initializes the refill pools' timer store
func (Keeper) LeftoverBurnRate ¶
LeftoverBurnRate returns the LeftoverBurnRate param
func (Keeper) MaxBondedTarget ¶
MaxBondedTarget returns the MaxBondedTarget param
func (Keeper) MaxRewardBoost ¶
MaxRewardBoost returns the MaxRewardBoost param
func (Keeper) MinBondedTarget ¶
MinBondedTarget returns the MinBondedTarget param
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) Pools ¶
func (k Keeper) Pools(goCtx context.Context, req *types.QueryPoolsRequest) (*types.QueryPoolsResponse, error)
func (Keeper) RefillRewardsPools ¶
RefillRewardsPools is called once a month (as a timer callback). it does the following for validators:
- burns the current token in the validators distribution pool by the burn rate
- transfers the monthly tokens quota from the validators allocation pool to the validators distribution pool
- opens a new timer for the next month (and encodes the expiry block and months left to allocation pool in it)
for providers: TBD
func (Keeper) SetAllBasePay ¶
func (k Keeper) SetAllBasePay(ctx sdk.Context, list []types.BasePayGenesis)
SetAllBasePay sets all BasePay
func (Keeper) TimeToNextTimerExpiry ¶
TimeToNextTimerExpiry returns the time in which the timer will expire (according to the current block time)
func (Keeper) TotalPoolTokens ¶
TotalPoolTokens gets the total tokens supply from a pool