diff --git a/app/upgrades/types.go b/app/upgrades/types.go index 0f68ae2af..e3556974c 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -33,6 +33,7 @@ const ( V010404rc0UpgradeName = "v1.4.4-rc.0" V010404beta8UpgradeName = "v1.4.4-beta.8" V010404rc1UpgradeName = "v1.4.4-rc.1" + V010404beta9UpgradeName = "v1.4.4-beta.9" ) // Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal diff --git a/app/upgrades/upgrades.go b/app/upgrades/upgrades.go index ec7ccedca..c5a20696b 100644 --- a/app/upgrades/upgrades.go +++ b/app/upgrades/upgrades.go @@ -35,6 +35,7 @@ func Upgrades() []Upgrade { {UpgradeName: V010404rc0UpgradeName, CreateUpgradeHandler: V010404rc0UpgradeHandler}, {UpgradeName: V010404beta8UpgradeName, CreateUpgradeHandler: V010404beta8UpgradeHandler}, {UpgradeName: V010404rc1UpgradeName, CreateUpgradeHandler: V010404rc1UpgradeHandler}, + {UpgradeName: V010404beta9UpgradeName, CreateUpgradeHandler: V010404beta9UpgradeHandler}, } } @@ -507,6 +508,33 @@ func V010404rc1UpgradeHandler( } } +func V010404beta9UpgradeHandler( + 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 isTest(ctx) || isDevnet(ctx) { + + appKeepers.InterchainstakingKeeper.RemoveZoneAndAssociatedRecords(ctx, JunoTestnetChainID) + vals := appKeepers.InterchainstakingKeeper.GetValidators(ctx, JunoTestnetChainID) + for _, val := range vals { + valoper, _ := addressutils.ValAddressFromBech32(val.ValoperAddress, "junovaloper") + appKeepers.InterchainstakingKeeper.DeleteValidator(ctx, JunoTestnetChainID, valoper) + } + + pdType, exists := prtypes.ProtocolDataType_value["ProtocolDataTypeConnection"] + if !exists { + panic("connection protocol data type not found") + } + + appKeepers.ParticipationRewardsKeeper.DeleteProtocolData(ctx, prtypes.GetProtocolDataKey(prtypes.ProtocolDataType(pdType), []byte(JunoTestnetChainID))) + + } + return mm.RunMigrations(ctx, configurator, fromVM) + } +} + // func V010400UpgradeHandler( // mm *module.Manager, // configurator module.Configurator,