Skip to content

Commit

Permalink
refactor(inflation): make inflation disabled by default
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yang committed Dec 15, 2023
1 parent 75a147e commit 528f86d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
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 528f86d

Please sign in to comment.