keeper

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: Apache-2.0 Imports: 11 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)

BeforeEpochStart 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,
	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) AllocateInflation

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

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

  • staking rewards -> sdk `auth` module fee collector

func (Keeper) BeforeEpochStart

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

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

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.

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

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

GetSkippedEpochs gets the number of skipped epochs.

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Hooks Return the wrapper struct

func (Keeper) InflationPeriod

InflationPeriod returns the current period information of the inflation module.

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

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

SetEpochIdentifier 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.

Jump to

Keyboard shortcuts

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