keeper

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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
}

Keeper of the inflation store

func NewKeeper

func NewKeeper(
	storeKey sdk.StoreKey,
	cdc codec.BinaryCodec,
	ps paramtypes.Subspace,
	ak types.AccountKeeper,
	bk types.BankKeeper,
	dk types.DistrKeeper,
	sk types.StakingKeeper,
	feeCollectorName string,
) Keeper

NewKeeper creates a new mint Keeper instance

func (Keeper) AfterEpochEnd

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

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

func (Keeper) AllocateExponentialInflation

func (k Keeper) AllocateExponentialInflation(ctx sdk.Context, mintedCoin sdk.Coin) error

AllocateExponentialInflation 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(_ sdk.Context, _ string, _ int64)

BeforeEpochStart: noop, We don't need to do anything here

func (Keeper) BondedRatio

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

BondedRatio the fraction of the staking tokens which are currently bonded It doesn't consider team allocation for inflation

func (Keeper) EpochMintProvision

EpochMintProvision returns the EpochMintProvision of the inflation module.

func (Keeper) GetEpochIdentifier

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

GetEpochIdentifier gets the epoch identifier

func (Keeper) GetEpochMintProvision

func (k Keeper) GetEpochMintProvision(ctx sdk.Context) (sdk.Dec, bool)

GetEpochMintProvision gets the current EpochMintProvision

func (Keeper) GetEpochsPerPeriod

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

GetEpochsPerPeriod gets the epochs per period

func (Keeper) GetParams

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

GetParams returns the total set of inflation parameters.

func (Keeper) GetPeriod

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

GetPeriod gets current period

func (Keeper) GetProportions

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

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

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) MintAndAllocateInflation

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

MintAndAllocateInflation performs inflation minting and allocation

func (Keeper) MintCoins

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

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

func (Keeper) Params

Params returns params of the mint module.

func (Keeper) Period

Period returns the current period of the inflation module.

func (Keeper) SetEpochIdentifier

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

SetEpochsPerPeriod stores the epoch identifier

func (Keeper) SetEpochMintProvision

func (k Keeper) SetEpochMintProvision(ctx sdk.Context, epochMintProvision sdk.Dec)

SetEpochMintProvision sets the current EpochMintProvision

func (Keeper) SetEpochsPerPeriod

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

SetEpochsPerPeriod stores the epochs per period

func (Keeper) SetParams

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

SetParams sets the inflation parameters to the param space.

func (Keeper) SetPeriod

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

SetPeriod stores the current period

type Migrator

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

Jump to

Keyboard shortcuts

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