Skip to content

Commit

Permalink
ensure ibc migration is included in 1.6.0-beta0 handler (#1508)
Browse files Browse the repository at this point in the history
* ensure ibc migration is included in 1.6.0-beta0 handler

* lint fix: linter doesn't like v6 alias, but vscode insists on re-adding it...
  • Loading branch information
Joe Bowman authored Apr 26, 2024
1 parent 95a127b commit 1e8885b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/upgrades/v1_6.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ package upgrades
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

v6migration "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller/migrations/v6"

"github.com/quicksilver-zone/quicksilver/app/keepers"
icstypes "github.com/quicksilver-zone/quicksilver/x/interchainstaking/types"
)

// ============ TESTNET UPGRADE HANDLERS ============
Expand All @@ -17,6 +21,19 @@ func V010600beta0UpgradeHandler(
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
if isTestnet(ctx) {
appKeepers.UpgradeKeeper.Logger(ctx).Info("migrating capabilities")
err := v6migration.MigrateICS27ChannelCapability(
ctx,
appKeepers.IBCKeeper.Codec(),
appKeepers.GetKey(capabilitytypes.StoreKey),
appKeepers.CapabilityKeeper,
icstypes.ModuleName,
)
if err != nil {
panic(err)
}

appKeepers.UpgradeKeeper.Logger(ctx).Info("removing defunct zones")
appKeepers.InterchainstakingKeeper.RemoveZoneAndAssociatedRecords(ctx, "agoric-3")
appKeepers.InterchainstakingKeeper.RemoveZoneAndAssociatedRecords(ctx, "archway-1")
appKeepers.InterchainQueryKeeper.SetLatestHeight(ctx, "provider", 6209948)
Expand Down

0 comments on commit 1e8885b

Please sign in to comment.