From b726045dd1b3bc03f15b7220b9e5bac25bf8f339 Mon Sep 17 00:00:00 2001 From: Joan Garcia Tormo Date: Mon, 22 Jul 2024 15:08:26 +0100 Subject: [PATCH] v3.1.4 handler --- app/app_upgrades.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/app/app_upgrades.go b/app/app_upgrades.go index f879aa30..40e2a991 100644 --- a/app/app_upgrades.go +++ b/app/app_upgrades.go @@ -25,6 +25,7 @@ func (app *App) SetUpgradeHandlers() { setHandlerForVersion_1_2_3(app) setHandlerForVersion_1_2_4(app) setHandlerForVersion_1_2_5(app) + setHandlerForVersion_3_1_4(app) } func setHandlerForVersion_1_0(app *App) { @@ -215,3 +216,29 @@ func setHandlerForVersion_1_2_5(app *App) { app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) } } +func setHandlerForVersion_3_1_4(app *App) { + const upgradeVersion string = "v3.1.4" + + app.UpgradeKeeper.SetUpgradeHandler(upgradeVersion, func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return app.mm.RunMigrations(ctx, app.configurator, fromVM) + }) + + upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() + if err != nil { + panic(err) + } + + if upgradeInfo.Name == upgradeVersion && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + storeUpgrades := storetypes.StoreUpgrades{ + Added: []string{}, + Deleted: []string{ + AddressBookModuleName, + MarketplaceModuleName, + NftModuleName, + GroupModuleName, + }, + } + + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) + } +}