diff --git a/app/app.go b/app/app.go index 163246657..2194acbf5 100644 --- a/app/app.go +++ b/app/app.go @@ -344,6 +344,7 @@ func NewLikeApp( skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) + app.setupUpgradeStoreLoaders() app.registerUpgradeHandlers() app.IscnKeeper = iscnkeeper.NewKeeper(appCodec, keys[iscntypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, iscnSubspace) @@ -572,6 +573,19 @@ func (app *LikeApp) registerUpgradeHandlers() { }) } +func (app *LikeApp) setupUpgradeStoreLoaders() { + upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() + if err != nil { + panic(err) + } + if upgradeInfo.Name == UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + storeUpgrades := storetypes.StoreUpgrades{ + Added: []string{"group"}, + } + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) + } +} + func (app *LikeApp) Name() string { return app.BaseApp.Name() }