Documentation ¶
Index ¶
- Constants
- Variables
- func ErrInvalidProposalInflation(codespace sdk.CodespaceType) sdk.Error
- func ErrInvalidProposalNodeCostPerMonth(codespace sdk.CodespaceType) sdk.Error
- func ErrInvalidProposalPrice(codespace sdk.CodespaceType) sdk.Error
- func ParamKeyTable() params.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func ValidateMinter(minter Minter) error
- func ValidateParams(params Params) error
- type CodeType
- type Minter
- type Params
- type StakingKeeper
- type SupplyKeeper
- type TokenKeeper
Constants ¶
View Source
const ( EventTypeMint = ModuleName EventExecuteInflationParameterChangeProposal = "execute_inflation_parameter_change_proposal" AttributeKeyInflation = "inflation" AttributeKeyInitialPrice = "initial_price" AttributeKeyCurrentPrice = "current_price" AttributeKeyNodeCostPerMonth = "node_cost_per_month" )
Minting module event types
View Source
const ( // module name ModuleName = "mint" // default paramspace for params keeper DefaultParamspace = ModuleName // StoreKey is the default store key for mint StoreKey = ModuleName // QuerierRoute is the querier route for the minting store. QuerierRoute = StoreKey //RouterKey RouterKey = ModuleName // Query endpoints supported by the minting querier QueryParameters = "parameters" QueryInflation = "inflation" QueryAnnualProvisions = "annual_provisions" )
nolint
View Source
const (
NativeTokenDecimals = 18 //TODO(Keep), should retrieve from token
)
Variables ¶
View Source
var ( KeyMintDenom = []byte("MintDenom") KeyInflation = []byte("Inflation") KeyMintPerBlock = []byte("MintPerBlock") )
Parameter store keys
View Source
var MinterKey = []byte{0x00}
the one key to use for the keeper store
View Source
var ModuleCdc *codec.Codec
generic sealed codec to be used throughout this module
View Source
var PrecisionMutipler = sdk.NewIntFromBigInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(NativeTokenDecimals), nil))
Functions ¶
func ErrInvalidProposalInflation ¶
func ErrInvalidProposalInflation(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidProposalNodeCostPerMonth ¶
func ErrInvalidProposalNodeCostPerMonth(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidProposalPrice ¶
func ErrInvalidProposalPrice(codespace sdk.CodespaceType) sdk.Error
func RegisterCodec ¶
Types ¶
type CodeType ¶
const ( DefaultCodespace sdk.CodespaceType = "mint" CodeInvalidInput CodeType = 103 )
type Minter ¶
type Minter struct{}
Minter represents the minting state.
func DefaultInitialMinter ¶
func DefaultInitialMinter() Minter
DefaultInitialMinter returns a default initial Minter object for a new chain which uses an inflation rate of 13%.
func InitialMinter ¶
func InitialMinter() Minter
InitialMinter returns an initial Minter object with a given inflation value.
type Params ¶
type Params struct { MintDenom string `json:"mint_denom" yaml:"mint_denom"` // type of coin to mint Inflation sdk.Dec `json:"inflation" yaml:"inflation"` //target inflation, default=3% MintPerBlock sdk.Int `json:"mint_per_block" yaml:"mint_per_block"` //target inflation, default=3% }
mint parameters
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
Implements params.ParamSet
type StakingKeeper ¶
type StakingKeeper interface { StakingTokenSupply(ctx sdk.Context) sdk.Int BondedRatio(ctx sdk.Context) sdk.Dec TotalBondedTokens(ctx sdk.Context) sdk.Int GetLastValidators(ctx sdk.Context) (validators []stakingtypes.Validator) }
StakingKeeper defines the expected staking keeper
type SupplyKeeper ¶
type SupplyKeeper interface { GetModuleAddress(name string) sdk.CUAddress // TODO remove with genesis 2-phases refactor https://github.com/hbtc-chain/bhchain/issues/2862 SetModuleAccount(sdk.Context, exported.ModuleAccountI) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.CUAddress, amt sdk.Coins) (sdk.Result, sdk.Error) SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) (sdk.Result, sdk.Error) MintCoins(ctx sdk.Context, name string, amt sdk.Coins) sdk.Error }
SupplyKeeper defines the expected supply keeper
Click to show internal directories.
Click to hide internal directories.