diff --git a/app/upgrades/types.go b/app/upgrades/types.go index ea8185555..73a1ed652 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -26,6 +26,7 @@ const ( V010500rc1UpgradeName = "v1.5.0-rc1" V010503rc0UpgradeName = "v1.5.3-rc0" V010600beta0UpgradeName = "v1.6.0-beta0" + V010600beta1UpgradeName = "v1.6.0-beta1" V010600rc0UpgradeName = "v1.6.0-rc0" V010600rc1UpgradeName = "v1.6.0-rc1" diff --git a/app/upgrades/upgrades.go b/app/upgrades/upgrades.go index 7aff0e960..1f079f28e 100644 --- a/app/upgrades/upgrades.go +++ b/app/upgrades/upgrades.go @@ -20,6 +20,7 @@ func Upgrades() []Upgrade { {UpgradeName: V010500rc1UpgradeName, CreateUpgradeHandler: V010500rc1UpgradeHandler}, {UpgradeName: V010503rc0UpgradeName, CreateUpgradeHandler: V010503rc0UpgradeHandler}, {UpgradeName: V010600beta0UpgradeName, CreateUpgradeHandler: V010600beta0UpgradeHandler}, + {UpgradeName: V010600beta1UpgradeName, CreateUpgradeHandler: V010600beta1UpgradeHandler}, {UpgradeName: V010600rc0UpgradeName, CreateUpgradeHandler: V010600rc0UpgradeHandler}, // v1.2: this needs to be present to support upgrade on mainnet diff --git a/app/upgrades/v1_6.go b/app/upgrades/v1_6.go index 24618e19a..2692b8a59 100644 --- a/app/upgrades/v1_6.go +++ b/app/upgrades/v1_6.go @@ -14,6 +14,20 @@ import ( // ============ TESTNET UPGRADE HANDLERS ============ +func V010600beta1UpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + appKeepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + if isTestnet(ctx) { + appKeepers.UpgradeKeeper.Logger(ctx).Info("removing defunct zones") + appKeepers.InterchainstakingKeeper.RemoveZoneAndAssociatedRecords(ctx, "elgafar-1") + } + return mm.RunMigrations(ctx, configurator, fromVM) + } +} + func V010600beta0UpgradeHandler( mm *module.Manager, configurator module.Configurator,