Documentation ¶
Index ¶
- Constants
- Variables
- func ParamKeyTable() paramtypes.KeyTable
- func ValidateGenesis(data GenesisState) error
- func ValidateMinter(minter Minter) error
- type AccountKeeper
- type BankKeeper
- type GenesisState
- type Minter
- func (m Minter) BlockProvision(params Params) sdk.Coin
- func (*Minter) Descriptor() ([]byte, []int)
- func (m *Minter) Marshal() (dAtA []byte, err error)
- func (m *Minter) MarshalTo(dAtA []byte) (int, error)
- func (m *Minter) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m Minter) NextAnnualProvisions(_ Params, totalSupply sdk.Int) sdk.Dec
- func (m Minter) NextInflationRate(params Params, bondedRatio sdk.Dec) sdk.Dec
- func (*Minter) ProtoMessage()
- func (m *Minter) Reset()
- func (m *Minter) Size() (n int)
- func (m *Minter) String() string
- func (m *Minter) Unmarshal(dAtA []byte) error
- func (m *Minter) XXX_DiscardUnknown()
- func (m *Minter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Minter) XXX_Merge(src proto.Message)
- func (m *Minter) XXX_Size() int
- func (m *Minter) XXX_Unmarshal(b []byte) error
- type Params
- func (*Params) Descriptor() ([]byte, []int)
- func (m *Params) GetBlocksPerYear() uint64
- func (m *Params) GetMintDenom() string
- func (m *Params) Marshal() (dAtA []byte, err error)
- func (m *Params) MarshalTo(dAtA []byte) (int, error)
- func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs
- func (*Params) ProtoMessage()
- func (m *Params) Reset()
- func (m *Params) Size() (n int)
- func (p Params) String() string
- func (m *Params) Unmarshal(dAtA []byte) error
- func (p Params) Validate() error
- func (m *Params) XXX_DiscardUnknown()
- func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Params) XXX_Merge(src proto.Message)
- func (m *Params) XXX_Size() int
- func (m *Params) XXX_Unmarshal(b []byte) error
- type StakingKeeper
Constants ¶
const ( EventTypeMint = ModuleName AttributeKeyBondedRatio = "bonded_ratio" AttributeKeyInflation = "inflation" AttributeKeyAnnualProvisions = "annual_provisions" )
Minting module event types
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 // Query endpoints supported by the minting querier QueryParameters = "parameters" QueryInflation = "inflation" QueryAnnualProvisions = "annual_provisions" )
Variables ¶
var ( KeyMintDenom = []byte("MintDenom") KeyInflationRateChange = []byte("InflationRateChange") KeyInflationMax = []byte("InflationMax") KeyInflationMin = []byte("InflationMin") KeyGoalBonded = []byte("GoalBonded") KeyBlocksPerYear = []byte("BlocksPerYear") )
Parameter store keys
var ( ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") )
var MinterKey = []byte{0x00}
MinterKey is the key to use for the keeper store.
Functions ¶
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the provided genesis state to ensure the expected invariants holds.
Types ¶
type AccountKeeper ¶
type AccountKeeper interface { GetModuleAddress(name string) sdk.AccAddress // TODO remove with genesis 2-phases refactor https://github.com/ayher/anatha/issues/2862 SetModuleAccount(sdk.Context, types.ModuleAccountI) GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI }
AccountKeeper defines the contract required for account APIs.
type BankKeeper ¶
type BankKeeper interface { SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error MintCoins(ctx sdk.Context, name string, amt sdk.Coins) error }
BankKeeper defines the contract needed to be fulfilled for banking and supply dependencies.
type GenesisState ¶
type GenesisState struct { Minter Minter `json:"minter" yaml:"minter"` // minter object Params Params `json:"params" yaml:"params"` // inflation params }
GenesisState - minter state
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState creates a default GenesisState object
func NewGenesisState ¶
func NewGenesisState(minter Minter, params Params) GenesisState
NewGenesisState creates a new GenesisState object
type Minter ¶
type Minter struct { // current annual inflation rate Inflation github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=inflation,proto3,customtype=github.com/ayher/anatha/types.Dec" json:"inflation"` // current annual expected provisions AnnualProvisions github_com_cosmos_cosmos_sdk_types.Dec `` /* 169-byte string literal not displayed */ }
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 ¶
InitialMinter returns an initial Minter object with a given inflation value.
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) Descriptor ¶
func (*Minter) MarshalToSizedBuffer ¶
func (Minter) NextAnnualProvisions ¶
NextAnnualProvisions returns the annual provisions based on current total supply and inflation rate.
func (Minter) NextInflationRate ¶
NextInflationRate returns the new inflation rate for the next hour.
func (*Minter) ProtoMessage ¶
func (*Minter) ProtoMessage()
func (*Minter) XXX_DiscardUnknown ¶
func (m *Minter) XXX_DiscardUnknown()
func (*Minter) XXX_Marshal ¶
func (*Minter) XXX_Unmarshal ¶
type Params ¶
type Params struct { // type of coin to mint MintDenom string `protobuf:"bytes,1,opt,name=mint_denom,json=mintDenom,proto3" json:"mint_denom,omitempty"` // maximum annual change in inflation rate InflationRateChange github_com_cosmos_cosmos_sdk_types.Dec `` /* 184-byte string literal not displayed */ // maximum inflation rate InflationMax github_com_cosmos_cosmos_sdk_types.Dec `` /* 153-byte string literal not displayed */ // minimum inflation rate InflationMin github_com_cosmos_cosmos_sdk_types.Dec `` /* 153-byte string literal not displayed */ // goal of percent bonded atoms GoalBonded github_com_cosmos_cosmos_sdk_types.Dec `` /* 145-byte string literal not displayed */ // expected blocks per year BlocksPerYear uint64 `` /* 126-byte string literal not displayed */ }
mint parameters
func (*Params) Descriptor ¶
func (*Params) GetBlocksPerYear ¶
func (*Params) GetMintDenom ¶
func (*Params) MarshalToSizedBuffer ¶
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs
Implements params.ParamSet
func (*Params) ProtoMessage ¶
func (*Params) ProtoMessage()
func (*Params) XXX_DiscardUnknown ¶
func (m *Params) XXX_DiscardUnknown()