chore: document InflationCalculationFn (#11945)

This commit is contained in:
Facundo Medica 2022-05-12 03:31:20 -03:00 committed by GitHub
parent f9febea7d7
commit 92f7df3c9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,19 @@ order: 3
Minting parameters are recalculated and inflation
paid at the beginning of each block.
## NextInflationRate
## Inflation rate calculation
Inflation rate is calculated using an "inflation calculation function" that's
passed to the `NewAppModule` function. If no function is passed, then the SDK's
default inflation function will be used (`NextInflationRate`). In case a custom
inflation calculation logic is needed, this can be achieved by defining and
passing a function that matches `InflationCalculationFn`'s signature.
```go
type InflationCalculationFn func(ctx sdk.Context, minter Minter, params Params, bondedRatio sdk.Dec) sdk.Dec
```
### NextInflationRate
The target annual inflation rate is recalculated each block.
The inflation is also subject to a rate change (positive or negative)