Documentation
¶
Index ¶
- Constants
- Variables
- func BuildAllTotalMintQOSKey() []byte
- func BuildFirstBlockTimeKey() []byte
- func BuildInflationPhrasesKey() []byte
- func BuildTotalQOSKey() []byte
- func RegisterCodec(cdc *amino.Codec)
- func ValidateGenesis(gs GenesisState) error
- type GenesisState
- type InflationPhrase
- type InflationPhrases
- func (phrases InflationPhrases) Adapt(oldPhrases InflationPhrases) (newPhrase InflationPhrases)
- func (phrases InflationPhrases) ApplyQOS(phraseEndTime time.Time, amount uint64) (newPhrase InflationPhrases)
- func (phrases InflationPhrases) Equals(ips InflationPhrases) bool
- func (phrases InflationPhrases) GetPhrase(time time.Time) (phrase *InflationPhrase, exists bool)
- func (phrases InflationPhrases) GetPrePhrase(time time.Time) (phrase *InflationPhrase, exists bool)
- func (phrases InflationPhrases) Valid() error
- func (phrases InflationPhrases) ValidNewPhrases(newTotal, totalApplied uint64, newPhrases InflationPhrases) error
Constants ¶
View Source
const ( MapperName = "mint" InflationPhrasesKey = "phrases" )
Variables ¶
View Source
var ( EventTypeMint = "mint" AttributeKeyHeight = "height" AttributeKeyTokens = "tokens" )
View Source
var Cdc = baseabci.MakeQBaseCodec()
Functions ¶
func BuildAllTotalMintQOSKey ¶
func BuildAllTotalMintQOSKey() []byte
func BuildFirstBlockTimeKey ¶
func BuildFirstBlockTimeKey() []byte
func BuildInflationPhrasesKey ¶
func BuildInflationPhrasesKey() []byte
func BuildTotalQOSKey ¶
func BuildTotalQOSKey() []byte
func RegisterCodec ¶
func RegisterCodec(cdc *amino.Codec)
func ValidateGenesis ¶
func ValidateGenesis(gs GenesisState) error
Types ¶
type GenesisState ¶
type GenesisState struct { InflationPhrases InflationPhrases `json:"inflation_phrases"` FirstBlockTime int64 `json:"first_block_time"` //UTC().UNIX() AppliedQOSAmount uint64 `json:"applied_qos_amount"` TotalQOSAmount uint64 `json:"total_qos_amount"` }
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
func NewGenesisState ¶
func NewGenesisState(inflationPhrases InflationPhrases, firstBlockTime int64, appliedQOSAmount uint64, totalQOSAmount uint64) GenesisState
type InflationPhrase ¶
type InflationPhrase struct { EndTime time.Time `json:"end_time"` TotalAmount uint64 `json:"total_amount"` AppliedAmount uint64 `json:"applied_amount"` }
func (InflationPhrase) Equals ¶
func (phrase InflationPhrase) Equals(p InflationPhrase) bool
type InflationPhrases ¶
type InflationPhrases []InflationPhrase
func DefaultInflationPhrases ¶
func DefaultInflationPhrases() InflationPhrases
func (InflationPhrases) Adapt ¶
func (phrases InflationPhrases) Adapt(oldPhrases InflationPhrases) (newPhrase InflationPhrases)
适配旧通胀阶段,填充已发行
func (InflationPhrases) ApplyQOS ¶
func (phrases InflationPhrases) ApplyQOS(phraseEndTime time.Time, amount uint64) (newPhrase InflationPhrases)
释放通胀
func (InflationPhrases) Equals ¶
func (phrases InflationPhrases) Equals(ips InflationPhrases) bool
func (InflationPhrases) GetPhrase ¶
func (phrases InflationPhrases) GetPhrase(time time.Time) (phrase *InflationPhrase, exists bool)
获取时间点对应通胀阶段
func (InflationPhrases) GetPrePhrase ¶
func (phrases InflationPhrases) GetPrePhrase(time time.Time) (phrase *InflationPhrase, exists bool)
获取前一通胀阶段
func (InflationPhrases) ValidNewPhrases ¶
func (phrases InflationPhrases) ValidNewPhrases(newTotal, totalApplied uint64, newPhrases InflationPhrases) error
校验新通胀
Click to show internal directories.
Click to hide internal directories.