keeper

package
v0.0.0-...-7868e01 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: Apache-2.0 Imports: 21 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 instance of MsgServer

func NewQuerier

func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

Types

type Hooks

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

Hooks wrapper struct for incentives keeper

func (Hooks) AfterEpochEnd

func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64)

func (Hooks) BeforeEpochStart

func (h Hooks) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64)

epochs hooks

type Keeper

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

func (Keeper) ActivePots

ActivePots returns active pots

func (Keeper) ActivePotsIterator

func (k Keeper) ActivePotsIterator(ctx sdk.Context) sdk.Iterator

ActivePotsIterator returns iterator for active pots

func (Keeper) AddToPotRewards

func (k Keeper) AddToPotRewards(ctx sdk.Context, owner sdk.AccAddress, coins sdk.Coins, potID uint64) error

AddToPot add coins to pot

func (Keeper) AfterEpochEnd

func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64)

func (Keeper) BeforeEpochStart

func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64)

func (Keeper) BeginDistribution

func (k Keeper) BeginDistribution(ctx sdk.Context, pot types.Pot) error

BeginDistribution is a utility to begin distribution for a specific pot

func (Keeper) CreatePot

func (k Keeper) CreatePot(ctx sdk.Context, isPerpetual bool, owner sdk.AccAddress, coins sdk.Coins, distrTo lockuptypes.QueryCondition, startTime time.Time, numEpochsPaidOver uint64) (uint64, error)

CreatePot create a pot and send coins to the pot

func (Keeper) Distribute

func (k Keeper) Distribute(ctx sdk.Context, pot types.Pot) (sdk.Coins, error)

Distribute coins from pot according to its conditions

func (Keeper) FilteredLocksDistributionEst

func (k Keeper) FilteredLocksDistributionEst(ctx sdk.Context, pot types.Pot, filteredLocks []lockuptypes.PeriodLock) (types.Pot, sdk.Coins, error)

FilteredLocksDistributionEst estimate distribution amount coins from pot for fitting conditions

func (Keeper) FinishDistribution

func (k Keeper) FinishDistribution(ctx sdk.Context, pot types.Pot) error

FinishDistribution is a utility to finish distribution for a specific pot

func (Keeper) FinishedPotsIterator

func (k Keeper) FinishedPotsIterator(ctx sdk.Context) sdk.Iterator

FinishedPotsIterator returns iterator for finished pots

func (Keeper) GetActivePots

func (k Keeper) GetActivePots(ctx sdk.Context) []types.Pot

GetActivePots returns active pots

func (Keeper) GetFinishedPots

func (k Keeper) GetFinishedPots(ctx sdk.Context) []types.Pot

GetFinishedPots returns finished pots

func (Keeper) GetLocksToDistribution

func (k Keeper) GetLocksToDistribution(ctx sdk.Context, distrTo lockuptypes.QueryCondition) []lockuptypes.PeriodLock

GetLocksToDistribution get locks that are associated to a condition

func (Keeper) GetModuleDistributedCoins

func (k Keeper) GetModuleDistributedCoins(ctx sdk.Context) sdk.Coins

GetModuleDistributedCoins returns sum of distributed coins so far

func (Keeper) GetModuleToDistributeCoins

func (k Keeper) GetModuleToDistributeCoins(ctx sdk.Context) sdk.Coins

GetModuleToDistributeCoins returns sum of to distribute coins for all of the module

func (Keeper) GetNotFinishedPots

func (k Keeper) GetNotFinishedPots(ctx sdk.Context) []types.Pot

func (Keeper) GetParams

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

GetParams returns the total set params

func (Keeper) GetPotByID

func (k Keeper) GetPotByID(ctx sdk.Context, potID uint64) (*types.Pot, error)

GetPotByID Returns pot from pot ID

func (Keeper) GetPotFromIDs

func (k Keeper) GetPotFromIDs(ctx sdk.Context, refValue []byte) ([]types.Pot, error)

GetPotFromIDs returns pots from pot ids reference

func (Keeper) GetPots

func (k Keeper) GetPots(ctx sdk.Context) []types.Pot

GetPots returns pots both upcoming and active

func (Keeper) GetRewardsEst

func (k Keeper) GetRewardsEst(ctx sdk.Context, addr sdk.AccAddress, locks []lockuptypes.PeriodLock, pots []types.Pot, endEpoch int64) sdk.Coins

GetRewardsEst returns rewards estimation at a future specific time

func (Keeper) GetUpcomingPots

func (k Keeper) GetUpcomingPots(ctx sdk.Context) []types.Pot

GetUpcomingPots returns scheduled pots

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Return the wrapper struct

func (Keeper) Logger

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

func (Keeper) ModuleDistributedCoins

ModuleDistributedCoins returns coins that are distributed by module so far

func (Keeper) ModuleToDistributeCoins

ModuleToDistributeCoins returns coins that is going to be distributed

func (Keeper) PotByID

func (k Keeper) PotByID(goCtx context.Context, req *types.PotByIDRequest) (*types.PotByIDResponse, error)

PotByID returns Pot by id

func (Keeper) Pots

func (k Keeper) Pots(goCtx context.Context, req *types.PotsRequest) (*types.PotsResponse, error)

Pots returns pots both upcoming and active

func (Keeper) PotsIterator

func (k Keeper) PotsIterator(ctx sdk.Context) sdk.Iterator

PotsIterator returns iterator for all pots

func (Keeper) RewardsEst

RewardsEst returns rewards estimation at a future specific time

func (*Keeper) SetHooks

func (k *Keeper) SetHooks(ih types.IncentiveHooks) *Keeper

Set the gamm hooks

func (Keeper) SetParams

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

SetParams sets the total set of params

func (Keeper) SetPotWithRefKey

func (k Keeper) SetPotWithRefKey(ctx sdk.Context, pot *types.Pot) error

func (Keeper) UpcomingPots

UpcomingPots returns scheduled pots

func (Keeper) UpcomingPotsIterator

func (k Keeper) UpcomingPotsIterator(ctx sdk.Context) sdk.Iterator

UpcomingPotsIterator returns iterator for upcoming pots

func (Keeper) UpcomingPotsIteratorAfterTime

func (k Keeper) UpcomingPotsIteratorAfterTime(ctx sdk.Context, time time.Time) sdk.Iterator

UpcomingPotsIteratorAfterTime returns the iterator to get upcoming pots that start distribution after specific time

func (Keeper) UpcomingPotsIteratorBeforeTime

func (k Keeper) UpcomingPotsIteratorBeforeTime(ctx sdk.Context, time time.Time) sdk.Iterator

UpcomingPotsIteratorBeforeTime returns the iterator to get upcoming pots that already started distribution before specific time

Jump to

Keyboard shortcuts

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