Skip to content

Commit

Permalink
Merge pull request #259 from terra-money/fix/icq/store
Browse files Browse the repository at this point in the history
fix: icq store
  • Loading branch information
tuky191 authored Jan 28, 2024
2 parents afd2aac + c79f674 commit 7cbb1f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/upgrade_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func (app *TerraApp) RegisterUpgradeHandlers() {
app.GetModuleManager(),
app.GetConfigurator(),
app.GetAppCodec(),
app.Keepers.ICQKeeper,
),
)
}
Expand Down Expand Up @@ -121,7 +122,7 @@ func (app *TerraApp) RegisterUpgradeStores() {
storeUpgrades := storetypes.StoreUpgrades{Added: []string{icqtypes.StoreKey}}
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
} else if upgradeInfo.Name == terraappconfig.Upgrade2_9 && !app.Keepers.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
storeUpgrades := storetypes.StoreUpgrades{Deleted: []string{"builder"}}
storeUpgrades := storetypes.StoreUpgrades{Deleted: []string{"builder"}, Added: []string{icqtypes.StoreKey}}
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
}
}
8 changes: 8 additions & 0 deletions app/upgrades/v2.9/upgrade.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package v2_9

import (
icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v7/keeper"
icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
Expand All @@ -11,8 +14,13 @@ func CreateUpgradeHandler(
mm *module.Manager,
cfg module.Configurator,
cdc codec.Codec,
icqkeeper icqkeeper.Keeper,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// Interchain Queries
icqParams := icqtypes.NewParams(true, nil)
icqkeeper.SetParams(ctx, icqParams)

return mm.RunMigrations(ctx, cfg, fromVM)
}
}

0 comments on commit 7cbb1f5

Please sign in to comment.