2022-09-01 20:20:37 +00:00
|
|
|
package app
|
|
|
|
|
2024-02-13 18:27:27 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
|
|
"github.com/cosmos/cosmos-sdk/types/module"
|
|
|
|
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2024-08-09 06:11:35 +00:00
|
|
|
UpgradeName_Testnet = "v0.3.1"
|
2024-02-13 18:27:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// RegisterUpgradeHandlers registers the upgrade handlers for the app.
|
|
|
|
func (app App) RegisterUpgradeHandlers() {
|
|
|
|
app.upgradeKeeper.SetUpgradeHandler(
|
|
|
|
UpgradeName_Testnet,
|
|
|
|
upgradeHandler(app, UpgradeName_Testnet),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
// upgradeHandler returns an UpgradeHandler for the given upgrade parameters.
|
|
|
|
func upgradeHandler(
|
|
|
|
app App,
|
|
|
|
name string,
|
|
|
|
) upgradetypes.UpgradeHandler {
|
|
|
|
return func(
|
|
|
|
ctx sdk.Context,
|
|
|
|
plan upgradetypes.Plan,
|
|
|
|
fromVM module.VersionMap,
|
|
|
|
) (module.VersionMap, error) {
|
|
|
|
app.Logger().Info(fmt.Sprintf("running %s upgrade handler", name))
|
|
|
|
|
2024-08-09 06:11:35 +00:00
|
|
|
params := app.mintKeeper.GetParams(ctx)
|
|
|
|
params.MintDenom = "ua0gi"
|
|
|
|
app.mintKeeper.SetParams(ctx, params)
|
2024-02-13 18:27:27 +00:00
|
|
|
|
2024-03-29 18:05:26 +00:00
|
|
|
// run migrations for all modules and return new consensus version map
|
2024-08-09 06:11:35 +00:00
|
|
|
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
|
2024-02-13 18:27:27 +00:00
|
|
|
}
|
|
|
|
}
|