chore: fix mint comments on inflation rate (#14404)
This commit is contained in:
parent
739c5b0f30
commit
e4ac128840
@ -101,7 +101,7 @@ NextInflationRate(params Params, bondedRatio sdk.Dec) (inflation sdk.Dec) {
|
||||
inflationRateChangePerYear = (1 - bondedRatio/params.GoalBonded) * params.InflationRateChange
|
||||
inflationRateChange = inflationRateChangePerYear/blocksPerYr
|
||||
|
||||
// increase the new annual inflation for this next cycle
|
||||
// increase the new annual inflation for this next block
|
||||
inflation += inflationRateChange
|
||||
if inflation > params.InflationMax {
|
||||
inflation = params.InflationMax
|
||||
|
||||
@ -42,11 +42,11 @@ func ValidateMinter(minter Minter) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// NextInflationRate returns the new inflation rate for the next hour.
|
||||
// NextInflationRate returns the new inflation rate for the next block.
|
||||
func (m Minter) NextInflationRate(params Params, bondedRatio sdk.Dec) math.LegacyDec {
|
||||
// The target annual inflation rate is recalculated for each previsions cycle. The
|
||||
// inflation is also subject to a rate change (positive or negative) depending on
|
||||
// the distance from the desired ratio (67%). The maximum rate change possible is
|
||||
// The target annual inflation rate is recalculated for each block. The inflation
|
||||
// is also subject to a rate change (positive or negative) depending on the
|
||||
// distance from the desired ratio (67%). The maximum rate change possible is
|
||||
// defined to be 13% per year, however the annual inflation is capped as between
|
||||
// 7% and 20%.
|
||||
|
||||
@ -56,7 +56,7 @@ func (m Minter) NextInflationRate(params Params, bondedRatio sdk.Dec) math.Legac
|
||||
Mul(params.InflationRateChange)
|
||||
inflationRateChange := inflationRateChangePerYear.Quo(math.LegacyNewDec(int64(params.BlocksPerYear)))
|
||||
|
||||
// adjust the new annual inflation for this next cycle
|
||||
// adjust the new annual inflation for this next block
|
||||
inflation := m.Inflation.Add(inflationRateChange) // note inflationRateChange may be negative
|
||||
if inflation.GT(params.InflationMax) {
|
||||
inflation = params.InflationMax
|
||||
|
||||
Loading…
Reference in New Issue
Block a user