Skip to content

Commit

Permalink
set inflation max and min
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulBernal committed Apr 17, 2024
1 parent 1e74a42 commit 68114ab
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,26 @@ func (app *App) GanjaRevolution47_burn(_ upgradetypes.Plan) {
}
logger.Info(fmt.Sprintf("post migrate version map: %v", versionMap))

// Inflation control mechanism - TBD
// // Get the current params from Mint module
// mintParams := app.MintKeeper.GetParams(ctx)

// // Log the params BEFORE apply the new values
// logger.Info(fmt.Sprintf("Current values for Mint value: InflationMax: %s, InflationMin: %s, InflationRateChange: %s",
// mintParams.InflationMax.String(), mintParams.InflationMin.String(), mintParams.InflationRateChange.String()))

// // Reduce to half the value of inflation_max, inflation_min and inflation_rate_change
// mintParams.InflationMax = mintParams.InflationMax.Quo(sdk.NewDec(2))
// mintParams.InflationMin = mintParams.InflationMin.Quo(sdk.NewDec(2))
// mintParams.InflationRateChange = mintParams.InflationRateChange.Quo(sdk.NewDec(2))

// // Set the new values at Mint module
// if err := app.MintKeeper.SetParams(ctx, mintParams); err != nil {
// return nil, err
// }

// // Log the values after apply the changes
// logger.Info(fmt.Sprintf("New values for Mint value: InflationMax: %s, InflationMin: %s, InflationRateChange: %s",
// mintParams.InflationMax.String(), mintParams.InflationMin.String(), mintParams.InflationRateChange.String()))
// Inflation control mechanism
// Get the current params from Mint module
mintParams := app.MintKeeper.GetParams(ctx)

// Log the params BEFORE apply the new values
logger.Info(fmt.Sprintf("Current values for Mint value: InflationMax: %s, InflationMin: %s",
mintParams.InflationMax.String(), mintParams.InflationMin.String()))

// Set fixed values for InflationMax and InflationMin
mintParams.InflationMin = sdk.NewDec(0) // 0%
mintParams.InflationMax = sdk.NewDecWithPrec(7, 2) // 7%

// Set the new values at Mint module
if err := app.MintKeeper.SetParams(ctx, mintParams); err != nil {
return nil, err
}

// Log the values after apply the changes
logger.Info(fmt.Sprintf("New values for Mint value: InflationMax: %s, InflationMin: %s",
mintParams.InflationMax.String(), mintParams.InflationMin.String()))

return versionMap, err
// return app.mm.RunMigrations(ctx, app.configurator, fromVM)
Expand Down

0 comments on commit 68114ab

Please sign in to comment.