Documentation ¶
Index ¶
- Constants
- Variables
- func BeginBlocker(ctx sdk.Context, k Keeper)
- func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState)
- func NewQuerier(k Keeper) sdk.Querier
- func ParamKeyTable() params.KeyTable
- func ValidateGenesis(data GenesisState) error
- type BankKeeper
- type FeeCollectionKeeper
- type GenesisState
- type Keeper
- type Minter
- type Params
- type StakingKeeper
Constants ¶
const ( // ModuleName is the name of the module ModuleName = "minting" // default paramspace for params keeper DefaultParamspace = "mint" // StoreKey is the default store key for mint StoreKey = "mint" // QuerierRoute is the querier route for the minting store. QuerierRoute = StoreKey )
const ( QueryParameters = "parameters" QueryMinter = "minter" )
Query endpoints supported by the minting querier
Variables ¶
var ( // params store for inflation params ParamStoreKeyParams = []byte("params") )
Functions ¶
func BeginBlocker ¶
Inflate every block, update inflation parameters once per hour
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState)
new mint genesis
func NewQuerier ¶
NewQuerier returns a minting Querier handler.
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the provided genesis state to ensure the expected invariants holds.
Types ¶
type BankKeeper ¶
type FeeCollectionKeeper ¶
expected fee collection keeper interface
type GenesisState ¶
type GenesisState struct { Minter Minter `json:"minter"` // minter object Params Params `json:"params"` // inflation params }
GenesisState - minter state
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState creates a default GenesisState object
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper Keeper) GenesisState
ExportGenesis returns a GenesisState for a given context and keeper.
func NewGenesisState ¶
func NewGenesisState(minter Minter, params Params) GenesisState
NewGenesisState creates a new GenesisState object
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
keeper of the staking store
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, paramSpace params.Subspace, sk StakingKeeper, fck FeeCollectionKeeper, bankKeeper BankKeeper) Keeper
type Minter ¶
type Minter struct { MintDenom string `json:"mint_denom"` // type of coin to mint BlocksPerYear uint64 `json:"blocks_per_year"` // expected blocks per year }
Minter represents the minting state.
func DefaultMinter ¶
func DefaultMinter() Minter
DefaultMinter returns a default initial Minter object for a new chain
func NewMinter ¶
NewMinter returns a new Minter object with the given inflation and annual provisions values.
func (Minter) BlockProvision ¶
BlockProvision returns the provisions for a block based on the annual provisions rate.
func (Minter) NextAnnualProvisions ¶
NextAnnualProvisions returns the annual provisions based on inflation base and inflation rate.