chore: fix mint comments on inflation rate (#14404)

This commit is contained in:
Facundo Medica 2022-12-23 16:08:46 -03:00 committed by GitHub
parent 739c5b0f30
commit e4ac128840
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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