types

package
v1.6.55 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeMint = ModuleName

	AttributeAllBonded = "all_bonded"
)

Minting module event types

View Source
const (
	ModuleName        = "mint"
	DefaultParamspace = ModuleName

	QuerierRoute = ModuleName

	// Query endpoints supported by the minting querier
	QueryParameters       = "parameters"
	QueryInflation        = "inflation"
	QueryAnnualProvisions = "annual_provisions"

	AttributeKeyLatestMinted = "latest_minted"
)

Variables

View Source
var (
	KeyMintDenom           = []byte("MintDenom")
	KeyInflationRateChange = []byte("InflationRateChange")
	KeyInflationMax        = []byte("InflationMax")
	KeyInflationMin        = []byte("InflationMin")
	KeyGoalBonded          = []byte("GoalBonded")
	KeyBlocksPerYear       = []byte("BlocksPerYear")
)

Parameter store keys

View Source
var (
	ErrInvalidEndPoint = sdkerrors.Register(string(DefaultCodespace), uint32(CodeInvalidEndPoint), "invalid endpoint")
)
View Source
var LatestMintedKey = []byte{0x01}
View Source
var MintCdc *codec.Codec
View Source
var MinterKey = []byte{0x00}

the one key to use for the keeper store

Functions

func ParamKeyTable

func ParamKeyTable() params.KeyTable

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis validates the provided genesis state to ensure the expected invariants holds.

func ValidateMinter

func ValidateMinter(minter Minter) error

Types

type CodeType

type CodeType = sdk.CodeType
const (
	DefaultCodespace sdk.CodespaceType = "mint"

	CodeInvalidEndPoint CodeType = 1801
)

type GenesisState

type GenesisState struct {
	Minter Minter `json:"minter"`
	Params Params `json:"params"` // inflation param
}

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState creates a default GenesisState object

func NewGenesisState

func NewGenesisState(minter Minter, params Params) GenesisState

type Minter

type Minter struct {
	Inflation        sdk.Dec `json:"inflation"`         //current annual inflation rate
	AnnualProvisions sdk.Dec `json:"annual_provisions"` //current annual expected provisions
}

func DefaultInitialMinter

func DefaultInitialMinter() Minter

func InitialMinter

func InitialMinter(inflation, annual_provisions sdk.Dec) Minter

func NewMinter

func NewMinter(inflation, annualProvisions sdk.Dec) Minter

func (Minter) BlockProvision

func (m Minter) BlockProvision(params Params) sdk.Coin

BlockProvision returns the provisions for a block based on the annual provisions rate.

func (Minter) NextAnnualProvisions

func (m Minter) NextAnnualProvisions(_ Params, totalSupply sdk.Int) sdk.Dec

NextAnnualProvisions returns the annual provisions based on current total supply and inflation rate.

func (Minter) NextInflationRate

func (m Minter) NextInflationRate(params Params, bondedRatio sdk.Dec) sdk.Dec

type Params

type Params struct {
	MintDenom           string  `json:"mint_denom"`            //types of coin mint
	InflationRateChange sdk.Dec `json:"inflation_rate_change"` //maximum annual change in inflation rate
	InflationMax        sdk.Dec `json:"inflation_max"`         // maximum inflation rate
	InflationMin        sdk.Dec `json:"inflation_min"`         // minimum inflation rate
	GoalBonded          sdk.Dec `json:"goal_bonded"`           // goal of percent bonded atoms
	BlocksPerYear       uint64  `json:"blocks_per_year"`       // expected blocks per year
}

func DefaultParams

func DefaultParams() Params

func NewParams

func NewParams(mintDenom string, inflationRateChange, inflationMax, inflationMin, goalBonded sdk.Dec, blocksPerYear uint64,
) Params

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() params.ParamSetPairs

func (Params) String

func (p Params) String() string

func (Params) Validate

func (p Params) Validate() error

validate params

Jump to

Keyboard shortcuts

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