Skip to content

Commit

Permalink
refactor(inflation): make inflation disabled by default (#1712)
Browse files Browse the repository at this point in the history
* refactor(inflation): make inflation disabled by default

* chore: update changelog
  • Loading branch information
k-yang committed Dec 15, 2023
1 parent 776a4af commit 3f696de
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
7 changes: 2 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [v1.1.0](https://github.com/NibiruChain/nibiru/releases/tag/v1.1.0) - 2023-12-14
## [v1.1.0](https://github.com/NibiruChain/nibiru/releases/tag/v1.1.0) - 2023-12-15

* [[Release Link](https://github.com/NibiruChain/nibiru/releases/tag/v1.1.0)]
* [[Commits](https://github.com/NibiruChain/nibiru/commits/v1.1.0)]
Expand All @@ -58,10 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Improvements

* [#1695](https://github.com/NibiruChain/nibiru/pull/1695) - feat(inflation): add events for inflation distribution

### State Machine Breaking

* [#1682](https://github.com/NibiruChain/nibiru/pull/1682) - feat: add upgrade handler for v1.1.0
* [#1712](https://github.com/NibiruChain/nibiru/pull/1712) - refactor(inflation): turn inflation off by default

## [v1.0.0](https://github.com/NibiruChain/nibiru/releases/tag/v1.0.0)

Expand Down
4 changes: 4 additions & 0 deletions x/inflation/keeper/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import (
func TestEpochIdentifierAfterEpochEnd(t *testing.T) {
nibiruApp, ctx := testapp.NewNibiruTestAppAndContext()

params := nibiruApp.InflationKeeper.GetParams(ctx)
params.InflationEnabled = true
nibiruApp.InflationKeeper.SetParams(ctx, params)

feePoolOld := nibiruApp.DistrKeeper.GetFeePool(ctx)
nibiruApp.EpochsKeeper.AfterEpochEnd(ctx, epochstypes.DayEpochID, 1)
feePoolNew := nibiruApp.DistrKeeper.GetFeePool(ctx)
Expand Down
12 changes: 10 additions & 2 deletions x/inflation/keeper/inflation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,21 @@ func TestGetCirculatingSupplyAndInflationRate(t *testing.T) {
{
"high supply",
sdk.TokensFromConsensusPower(800_000_000, sdk.DefaultPowerReduction),
func(nibiruApp *app.NibiruApp, ctx sdk.Context) {},
func(nibiruApp *app.NibiruApp, ctx sdk.Context) {
params := nibiruApp.InflationKeeper.GetParams(ctx)
params.InflationEnabled = true
nibiruApp.InflationKeeper.SetParams(ctx, params)
},
sdk.MustNewDecFromStr("27.095518287362700000"),
},
{
"low supply",
sdk.TokensFromConsensusPower(400_000_000, sdk.DefaultPowerReduction),
func(nibiruApp *app.NibiruApp, ctx sdk.Context) {},
func(nibiruApp *app.NibiruApp, ctx sdk.Context) {
params := nibiruApp.InflationKeeper.GetParams(ctx)
params.InflationEnabled = true
nibiruApp.InflationKeeper.SetParams(ctx, params)
},
sdk.MustNewDecFromStr("54.191036574725400000"),
},
}
Expand Down
1 change: 1 addition & 0 deletions x/inflation/types/inflation_calculation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var ExpectedTotalInflation = sdk.NewDec(810_600_000_000_000)

func TestCalculateEpochMintProvision(t *testing.T) {
params := DefaultParams()
params.InflationEnabled = true

epochId := uint64(0)
totalInflation := sdk.ZeroDec()
Expand Down
2 changes: 1 addition & 1 deletion x/inflation/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var (
)

var (
DefaultInflation = true
DefaultInflation = false
DefaultPolynomialFactors = []sdk.Dec{
sdk.MustNewDecFromStr("-0.00014903"),
sdk.MustNewDecFromStr("0.07527647"),
Expand Down

0 comments on commit 3f696de

Please sign in to comment.