keeper

package
v4.2.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) incentive.MsgServer

NewMsgServerImpl returns an implementation of MsgServer for the x/incentive module.

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.Codec,
	storeKey storetypes.StoreKey,
	bk incentive.BankKeeper,
	lk incentive.LeverageKeeper,
) Keeper

func (Keeper) GetBonded

func (k Keeper) GetBonded(ctx sdk.Context, addr sdk.AccAddress, denom string, tier incentive.BondTier) sdk.Coin

GetBonded retrieves the amount of uTokens of a given denom which are bonded to a single tier by an account

func (Keeper) GetCommunityFundAddress

func (k Keeper) GetCommunityFundAddress(ctx sdk.Context) sdk.AccAddress

GetCommunityFundAddress retrieves the community fund address parameter. It is guaranteed to be either valid (by sdk.ValidateAddressFormat) or empty.

func (Keeper) GetIncentiveProgram

func (k Keeper) GetIncentiveProgram(ctx sdk.Context, id uint32) (
	incentive.IncentiveProgram, incentive.ProgramStatus, error,
)

GetIncentiveProgram gets an incentive program by ID, regardless of the program's status. Returns the program's status if found, or an error if it does not exist.

func (Keeper) GetLastRewardsTime

func (k Keeper) GetLastRewardsTime(ctx sdk.Context) uint64

GetLastRewardsTime gets the last unix time incentive rewards were computed globally by EndBlocker.

func (Keeper) GetMaxUnbondings

func (k Keeper) GetMaxUnbondings(ctx sdk.Context) uint32

GetMaxUnbondings gets the maximum number of unbondings an account is allowed to have at one time.

func (Keeper) GetNextProgramID

func (k Keeper) GetNextProgramID(ctx sdk.Context) uint32

GetNextProgramID gets the ID that will be assigned to the next incentive program passed by governance.

func (Keeper) GetParams

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

func (Keeper) GetRewardAccumulator

func (k Keeper) GetRewardAccumulator(ctx sdk.Context, bondDenom, rewardDenom string, tier incentive.BondTier,
) sdk.DecCoin

GetRewardAccumulator retrieves the reward accumulator of a reward token for a single bonded uToken and tier - for example, how much UMEE (reward) would have been earned by 1 ATOM bonded to the middle tier since genesis.

func (Keeper) GetRewardTracker

func (k Keeper) GetRewardTracker(ctx sdk.Context,
	addr sdk.AccAddress, bondDenom, rewardDenom string, tier incentive.BondTier,
) sdk.DecCoin

GetRewardTracker retrieves the reward tracker of a reward token for a single bonded uToken and tier on one account - this is the value of the reward accumulator for those specific denoms and tier the last time this account performed and action that requires a reward tracker update (i.e. Bond, Claim, BeginUnbonding, or being Liquidated).

func (Keeper) GetTierWeightMiddle

func (k Keeper) GetTierWeightMiddle(ctx sdk.Context) sdk.Dec

GetTierWeightShort gets the ratio of rewards received by the short tier of bonded assets. Ranges 0 - 1.

func (Keeper) GetTierWeightShort

func (k Keeper) GetTierWeightShort(ctx sdk.Context) sdk.Dec

GetTierWeightShort gets the ratio of rewards received by the middle tier of bonded assets. Ranges 0 - 1.

func (Keeper) GetTotalBonded

func (k Keeper) GetTotalBonded(ctx sdk.Context, denom string, tier incentive.BondTier) sdk.Coin

GetTotalBonded retrieves the total amount of uTokens of a given denom which are bonded to the incentive module

func (Keeper) GetUnbondingDurationLong

func (k Keeper) GetUnbondingDurationLong(ctx sdk.Context) uint64

GetUnbondingDurationLong gets the duration in seconds of the long bonding tier.

func (Keeper) GetUnbondingDurationMiddle

func (k Keeper) GetUnbondingDurationMiddle(ctx sdk.Context) uint64

GetUnbondingDurationMiddle gets the duration in seconds of the middle bonding tier.

func (Keeper) GetUnbondingDurationShort

func (k Keeper) GetUnbondingDurationShort(ctx sdk.Context) uint64

GetUnbondingDurationShort gets the duration in seconds of the short bonding tier.

func (Keeper) GetUnbondings

func (k Keeper) GetUnbondings(ctx sdk.Context, addr sdk.AccAddress) []incentive.Unbonding

GetUnbondings gets all unbondings currently associated with an account.

func (Keeper) KVStore

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

KVStore returns the module's KVStore

func (Keeper) Logger

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

func (Keeper) ModuleBalance

func (k Keeper) ModuleBalance(ctx sdk.Context, denom string) sdk.Coin

ModuleBalance returns the amount of a given token held in the x/incentive module account

func (Keeper) SetBonded

func (k Keeper) SetBonded(ctx sdk.Context,
	addr sdk.AccAddress, uToken sdk.Coin, tier incentive.BondTier,
) error

SetBonded sets the amount of uTokens of a given denom which are bonded to a single tier by an account

func (Keeper) SetIncentiveProgram

func (k Keeper) SetIncentiveProgram(ctx sdk.Context,
	program incentive.IncentiveProgram, status incentive.ProgramStatus,
) error

SetIncentiveProgram stores an incentive program in either the upcoming, ongoing, or completed program lists. does not validate the incentive program struct or the validity of its status change (e.g. upcoming -> complete)

func (Keeper) SetLastRewardsTime

func (k Keeper) SetLastRewardsTime(ctx sdk.Context, time uint64) error

SetLastRewardsTime sets the last unix time incentive rewards were computed globally by EndBlocker.

func (Keeper) SetNextProgramID

func (k Keeper) SetNextProgramID(ctx sdk.Context, id uint32) error

SetNextProgramID sets the ID that will be assigned to the next incentive program passed by governance.

func (Keeper) SetParams

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

SetParams validates and sets the incentive module parameters

func (Keeper) SetRewardAccumulator

func (k Keeper) SetRewardAccumulator(ctx sdk.Context,
	bondDenom string, reward sdk.DecCoin, tier incentive.BondTier,
) error

SetRewardAccumulator sets the reward accumulator of a reward token for a single bonded uToken and tier.

func (Keeper) SetRewardTracker

func (k Keeper) SetRewardTracker(ctx sdk.Context,
	addr sdk.AccAddress, bondDenom string, reward sdk.DecCoin, tier incentive.BondTier,
) error

SetRewardTracker sets the reward tracker of a reward token for a single bonded uToken and tier for an address.

func (Keeper) SetTotalBonded

func (k Keeper) SetTotalBonded(ctx sdk.Context, uTokens sdk.Coin, tier incentive.BondTier) error

SetTotalBonded records the total amount of uTokens of a given denom which are bonded to the incentive module

func (Keeper) SetUnbondings

func (k Keeper) SetUnbondings(ctx sdk.Context, unbondings incentive.AccountUnbondings) error

SetUnbondings stores the full list of unbondings currently associated with an account.

type Querier

type Querier struct {
	Keeper
}

Querier implements a QueryServer for the x/incentive module.

func NewQuerier

func NewQuerier(k Keeper) Querier

func (Querier) Bonded

func (Querier) Params

Jump to

Keyboard shortcuts

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