keeper

package
v0.32.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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 (k Keeper) AggregateRewards(ctx sdk.Context, provider, chainid string, adjustment sdk.Dec, rewards math.Int)

func (Keeper) AllocationPoolMonthsLeft

func (k Keeper) AllocationPoolMonthsLeft(ctx sdk.Context) int64

AllocationPoolMonthsLeft returns the amount of months the allocation pools have left before all their are depleted

func (Keeper) BeginBlock

func (k Keeper) BeginBlock(ctx sdk.Context)

redeclaring BeginBlock for testing (this is not called outside of unit tests)

func (Keeper) BlocksToNextTimerExpiry

func (k Keeper) BlocksToNextTimerExpiry(ctx sdk.Context) int64

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

func (k Keeper) BurnPoolTokens(ctx sdk.Context, pool types.Pool, amt math.Int) error

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 (k Keeper) DistributeBlockReward(ctx sdk.Context)

func (Keeper) ExportRewardsRefillTS

func (k Keeper) ExportRewardsRefillTS(ctx sdk.Context) timerstoretypes.GenesisState

ExportRewardsRefillTS exports refill pools timers data (for genesis)

func (Keeper) FundCommunityPoolFromModule

func (k Keeper) FundCommunityPoolFromModule(ctx sdk.Context, amount math.Int, senderModule string) error

func (Keeper) GetAllBasePay

func (k Keeper) GetAllBasePay(ctx sdk.Context) (list []types.BasePayGenesis)

GetAllBasePay returns all BasePay

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

GetParams get all parameters as types.Params

func (Keeper) InitRewardsRefillTS

func (k Keeper) InitRewardsRefillTS(ctx sdk.Context, gs timerstoretypes.GenesisState)

InitRewardsRefillTS initializes the refill pools' timer store

func (Keeper) LeftoverBurnRate

func (k Keeper) LeftoverBurnRate(ctx sdk.Context) (res sdk.Dec)

LeftoverBurnRate returns the LeftoverBurnRate param

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) LowFactor

func (k Keeper) LowFactor(ctx sdk.Context) (res sdk.Dec)

LowFactor returns the LowFactor param

func (Keeper) MaxBondedTarget

func (k Keeper) MaxBondedTarget(ctx sdk.Context) (res sdk.Dec)

MaxBondedTarget returns the MaxBondedTarget param

func (Keeper) MaxRewardBoost

func (k Keeper) MaxRewardBoost(ctx sdk.Context) (res uint64)

MaxRewardBoost returns the MaxRewardBoost param

func (Keeper) MinBondedTarget

func (k Keeper) MinBondedTarget(ctx sdk.Context) (res sdk.Dec)

MinBondedTarget returns the MinBondedTarget param

func (Keeper) Params

func (Keeper) Pools

func (Keeper) RefillRewardsPools

func (k Keeper) RefillRewardsPools(ctx sdk.Context, _ []byte, data []byte)

RefillRewardsPools is called once a month (as a timer callback). it does the following for validators:

  1. burns the current token in the validators distribution pool by the burn rate
  2. transfers the monthly tokens quota from the validators allocation pool to the validators distribution pool
  3. 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) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams set the params

func (Keeper) TimeToNextTimerExpiry

func (k Keeper) TimeToNextTimerExpiry(ctx sdk.Context) int64

TimeToNextTimerExpiry returns the time in which the timer will expire (according to the current block time)

func (Keeper) TotalPoolTokens

func (k Keeper) TotalPoolTokens(ctx sdk.Context, pool types.Pool) math.Int

TotalPoolTokens gets the total tokens supply from a pool

func (Keeper) ValidatorsSubscriptionParticipation

func (k Keeper) ValidatorsSubscriptionParticipation(ctx sdk.Context) (res sdk.Dec)

ValidatorsSubscriptionParticipation returns the ValidatorsSubscriptionParticipation param

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL