keeper

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: GPL-3.0, Apache-2.0 Imports: 13 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 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 NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	authority string,

	bankKeeper types.BankKeeper,
	distrKeeper types.DistrKeeper,
) Keeper

func (Keeper) AfterEpochEnd

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

TODO: switch BeforeEpochStart and AfterEpochEnd

func (Keeper) AllocateInflation

func (k Keeper) AllocateInflation(
	ctx sdk.Context,
	mintedCoin sdk.Coin,
	params types.Params,
) (
	validatorsCoins sdk.Coins,
	otherCoins []sdk.Coins,

	err error,
)

AllocateInflation allocates coins from the inflation to external modules according to allocation proportions:

  • staking rewards -> sdk `auth` module fee collector
  • usage incentives -> `x/incentives` module
  • community pool -> `sdk `distr` module community pool

func (Keeper) BeforeEpochStart

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

AfterEpochEnd mints and allocates coins at the end of each epoch end

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the module's authority.

func (Keeper) GetEpochIdentifier

func (k Keeper) GetEpochIdentifier(ctx sdk.Context) string

GetEpochIdentifier gets the epoch identifier

func (Keeper) GetEpochsPerPeriod

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

GetEpochsPerPeriod gets the epochs per period

func (Keeper) GetInflationDistribution

func (k Keeper) GetInflationDistribution(ctx sdk.Context) (dist types.InflationDistribution, found bool)

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) GetPeriod

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

GetPeriod gets current period

func (Keeper) GetPeriodMintProvisions

func (k Keeper) GetPeriodMintProvisions(ctx sdk.Context) (sdk.DecCoins, error)

func (Keeper) GetProportions

func (k Keeper) GetProportions(
	_ sdk.Context,
	coin sdk.Coin,
	distribution sdk.Dec,
) sdk.Coin

GetProportion calculates the proportion of coins that is to be allocated during inflation for a given distribution.

func (Keeper) GetSkippedEpochs

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

GetSkippedEpochs gets the number of skipped epochs

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Return the wrapper struct

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) MintCoins

func (k Keeper) MintCoins(ctx sdk.Context, coin sdk.Coin) error

MintCoins implements an alias call to the underlying supply keeper's MintCoins to be used in BeginBlocker.

func (Keeper) Params

func (Keeper) SetEpochIdentifier

func (k Keeper) SetEpochIdentifier(ctx sdk.Context, epochIdentifier string)

SetEpochsPerPeriod stores the epoch identifier

func (Keeper) SetEpochsPerPeriod

func (k Keeper) SetEpochsPerPeriod(ctx sdk.Context, epochsPerPeriod int64)

SetEpochsPerPeriod stores the epochs per period

func (Keeper) SetInflationDistribution

func (k Keeper) SetInflationDistribution(ctx sdk.Context, dist types.InflationDistribution) error

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetPeriod

func (k Keeper) SetPeriod(ctx sdk.Context, period uint64)

SetPeriod stores the current period

func (Keeper) SetPeriodMintProvisions

func (k Keeper) SetPeriodMintProvisions(ctx sdk.Context, provisions sdk.DecCoins) error

func (Keeper) SetSkippedEpochs

func (k Keeper) SetSkippedEpochs(ctx sdk.Context, skippedEpochs uint64)

SetSkippedEpochs stores the number of skipped epochs

Jump to

Keyboard shortcuts

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