keeper

package
v7.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: LGPL-3.0 Imports: 14 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 allocates coins at the end of each epoch end

func (Keeper) AllocateExponentialInflation

func (k Keeper) AllocateExponentialInflation(
	ctx sdk.Context,
	mintedCoin sdk.Coin,
) (
	staking, communityPool sdk.Coins,
	err error,
)

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

  • staking rewards -> sdk `auth` module fee collector
  • 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) CirculatingSupply

CirculatingSupply returns the total supply in circulation excluding the team allocation in the first year

func (Keeper) EpochMintProvision

EpochMintProvision returns the EpochMintProvision of the inflation module.

func (Keeper) GetCirculatingSupply

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

GetCirculatingSupply returns the bank supply of the mintDenom

func (Keeper) GetComPool

func (k Keeper) GetComPool(ctx sdk.Context) sdk.DecCoins

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

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

GetInflationRate returns the inflation rate for the current 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) 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) InflationRate

InflationRate returns the number of skipped Epochs of the inflation module.

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,
) (
	staking, communityPool sdk.Coins,
	err error,
)

MintAndAllocateInflation performs inflation minting and allocation

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

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

func (Keeper) SetSkippedEpochs

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

SetSkippedEpochs stores the number of skipped epochs

func (Keeper) SkippedEpochs

SkippedEpochs returns the number of skipped Epochs of the inflation module.

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.

func (Migrator) Migrate1to2

func (m Migrator) Migrate1to2(ctx sdk.Context) error

Jump to

Keyboard shortcuts

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