keeper

package
v0.11.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

NewQuerier is the module level router for state queries

Types

type Keeper

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

Keeper keeper for the incentive module

func NewKeeper

func NewKeeper(
	cdc *codec.Codec, key sdk.StoreKey, paramstore subspace.Subspace, sk types.SupplyKeeper,
	cdpk types.CdpKeeper, ak types.AccountKeeper,
) Keeper

NewKeeper creates a new keeper

func (Keeper) AddToClaim

func (k Keeper) AddToClaim(ctx sdk.Context, addr sdk.AccAddress, collateralType string, id uint64, amount sdk.Coin)

AddToClaim adds the amount to an existing claim or creates a new one for that amount

func (Keeper) ApplyRewardsToCdps

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

ApplyRewardsToCdps iterates over the reward periods and creates a claim for each cdp owner that created usdx with the collateral specified in the reward period.

func (Keeper) CreateAndDeleteRewardPeriods

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

CreateAndDeleteRewardPeriods creates reward periods for active rewards that don't already have a reward period and deletes reward periods for inactive rewards that currently have a reward period

func (Keeper) CreateNewRewardPeriod

func (k Keeper) CreateNewRewardPeriod(ctx sdk.Context, reward types.Reward)

CreateNewRewardPeriod creates a new reward period from the input reward

func (Keeper) CreateUniqueClaimPeriod

func (k Keeper) CreateUniqueClaimPeriod(ctx sdk.Context, collateralType string, end time.Time, multipliers types.Multipliers)

CreateUniqueClaimPeriod creates a new claim period in the store and updates the highest claim period id

func (Keeper) DeleteClaim

func (k Keeper) DeleteClaim(ctx sdk.Context, owner sdk.AccAddress, collateralType string, id uint64)

DeleteClaim deletes the claim in the store corresponding to the input address, collateral type, and id

func (Keeper) DeleteClaimPeriod

func (k Keeper) DeleteClaimPeriod(ctx sdk.Context, id uint64, collateralType string)

DeleteClaimPeriod deletes the claim period in the store for the input ID and collateral type

func (Keeper) DeleteExpiredClaimsAndClaimPeriods

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

DeleteExpiredClaimsAndClaimPeriods deletes expired claim periods and their associated claims

func (Keeper) DeleteRewardPeriod

func (k Keeper) DeleteRewardPeriod(ctx sdk.Context, collateralType string)

DeleteRewardPeriod deletes the reward period in the store for the input collateral type,

func (Keeper) GetActiveClaimsByAddressAndCollateralType added in v0.11.0

func (k Keeper) GetActiveClaimsByAddressAndCollateralType(ctx sdk.Context, addr sdk.AccAddress, collateralType string) (claims types.Claims, found bool)

GetActiveClaimsByAddressAndCollateralType returns all claims for a specific user and address and a bool for if any were found

func (Keeper) GetAllClaimPeriodIDPairs

func (k Keeper) GetAllClaimPeriodIDPairs(ctx sdk.Context) types.GenesisClaimPeriodIDs

GetAllClaimPeriodIDPairs returns all collateralType:nextClaimPeriodID pairs in the store

func (Keeper) GetAllClaimPeriods

func (k Keeper) GetAllClaimPeriods(ctx sdk.Context) types.ClaimPeriods

GetAllClaimPeriods returns all ClaimPeriod objects in the store

func (Keeper) GetAllClaims

func (k Keeper) GetAllClaims(ctx sdk.Context) types.Claims

GetAllClaims returns all Claim objects in the store

func (Keeper) GetAllClaimsByAddressAndCollateralType added in v0.11.0

func (k Keeper) GetAllClaimsByAddressAndCollateralType(ctx sdk.Context, addr sdk.AccAddress, collateralType string) (claims types.AugmentedClaims, found bool)

GetAllClaimsByAddressAndCollateralType returns all claims for a specific user and address and a bool for if any were found

func (Keeper) GetAllRewardPeriods

func (k Keeper) GetAllRewardPeriods(ctx sdk.Context) types.RewardPeriods

GetAllRewardPeriods returns all reward periods in the store

func (Keeper) GetClaim

func (k Keeper) GetClaim(ctx sdk.Context, addr sdk.AccAddress, collateralType string, id uint64) (types.Claim, bool)

GetClaim returns the claim in the store corresponding the the input address collateral type and id and a boolean for if the claim was found

func (Keeper) GetClaimPeriod

func (k Keeper) GetClaimPeriod(ctx sdk.Context, id uint64, collateralType string) (types.ClaimPeriod, bool)

GetClaimPeriod returns claim period in the store for the input ID and collateral type and a boolean for if it was found

func (Keeper) GetNextClaimPeriodID

func (k Keeper) GetNextClaimPeriodID(ctx sdk.Context, collateralType string) uint64

GetNextClaimPeriodID returns the highest claim period id in the store for the input collateral type

func (Keeper) GetParams

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

GetParams returns the params from the store

func (Keeper) GetPreviousBlockTime

func (k Keeper) GetPreviousBlockTime(ctx sdk.Context) (blockTime time.Time, found bool)

GetPreviousBlockTime get the blocktime for the previous block

func (Keeper) GetRewardPeriod

func (k Keeper) GetRewardPeriod(ctx sdk.Context, collateralType string) (types.RewardPeriod, bool)

GetRewardPeriod returns the reward period from the store for the input collateral type and a boolean for if it was found

func (Keeper) HandleRewardPeriodExpiry

func (k Keeper) HandleRewardPeriodExpiry(ctx sdk.Context, rp types.RewardPeriod)

HandleRewardPeriodExpiry deletes expired RewardPeriods from the store and creates a ClaimPeriod in the store for each expired RewardPeriod

func (Keeper) IterateClaimPeriodIDKeysAndValues

func (k Keeper) IterateClaimPeriodIDKeysAndValues(ctx sdk.Context, cb func(collateralType string, id uint64) (stop bool))

IterateClaimPeriodIDKeysAndValues iterates over the claim period id (value) and collateral type (key) of each claim period id in the store and performs a callback function

func (Keeper) IterateClaimPeriods

func (k Keeper) IterateClaimPeriods(ctx sdk.Context, cb func(cp types.ClaimPeriod) (stop bool))

IterateClaimPeriods iterates over all claim period objects in the store and preforms a callback function

func (Keeper) IterateClaims

func (k Keeper) IterateClaims(ctx sdk.Context, cb func(c types.Claim) (stop bool))

IterateClaims iterates over all claim objects in the store and preforms a callback function

func (Keeper) IterateRewardPeriods

func (k Keeper) IterateRewardPeriods(ctx sdk.Context, cb func(rp types.RewardPeriod) (stop bool))

IterateRewardPeriods iterates over all reward period objects in the store and preforms a callback function

func (Keeper) PayoutClaim

func (k Keeper) PayoutClaim(ctx sdk.Context, addr sdk.AccAddress, collateralType string, id uint64, multiplierName types.MultiplierName) error

PayoutClaim sends the timelocked claim coins to the input address

func (Keeper) SendTimeLockedCoinsToAccount

func (k Keeper) SendTimeLockedCoinsToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, length int64) error

SendTimeLockedCoinsToAccount sends time-locked coins from the input module account to the recipient. If the recipients account is not a vesting account and the input length is greater than zero, the recipient account is converted to a periodic vesting account and the coins are added to the vesting balance as a vesting period with the input length.

func (Keeper) SendTimeLockedCoinsToBaseAccount

func (k Keeper) SendTimeLockedCoinsToBaseAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, length int64) error

SendTimeLockedCoinsToBaseAccount sends time-locked coins from the input module account to the recipient, converting the recipient account to a vesting account

func (Keeper) SendTimeLockedCoinsToPeriodicVestingAccount

func (k Keeper) SendTimeLockedCoinsToPeriodicVestingAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, length int64) error

SendTimeLockedCoinsToPeriodicVestingAccount sends time-locked coins from the input module account to the recipient

func (Keeper) SetClaim

func (k Keeper) SetClaim(ctx sdk.Context, c types.Claim)

SetClaim sets the claim in the store corresponding to the input address, collateral type, and id

func (Keeper) SetClaimPeriod

func (k Keeper) SetClaimPeriod(ctx sdk.Context, cp types.ClaimPeriod)

SetClaimPeriod sets the claim period in the store for the input ID and collateral type

func (Keeper) SetNextClaimPeriodID

func (k Keeper) SetNextClaimPeriodID(ctx sdk.Context, collateralType string, id uint64)

SetNextClaimPeriodID sets the highest claim period id in the store for the input collateral type

func (Keeper) SetParams

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

SetParams sets params on the store

func (Keeper) SetPreviousBlockTime

func (k Keeper) SetPreviousBlockTime(ctx sdk.Context, blockTime time.Time)

SetPreviousBlockTime set the time of the previous block

func (Keeper) SetRewardPeriod

func (k Keeper) SetRewardPeriod(ctx sdk.Context, rp types.RewardPeriod)

SetRewardPeriod sets the reward period in the store for the input deno,

Jump to

Keyboard shortcuts

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