Skip to content

Commit

Permalink
add beat9 upgrade plan (#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajansari95 authored Jul 27, 2023
1 parent b69a5ee commit 6eb96c9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/upgrades/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions app/upgrades/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func Upgrades() []Upgrade {
{UpgradeName: V010404rc0UpgradeName, CreateUpgradeHandler: V010404rc0UpgradeHandler},
{UpgradeName: V010404beta8UpgradeName, CreateUpgradeHandler: V010404beta8UpgradeHandler},
{UpgradeName: V010404rc1UpgradeName, CreateUpgradeHandler: V010404rc1UpgradeHandler},
{UpgradeName: V010404beta9UpgradeName, CreateUpgradeHandler: V010404beta9UpgradeHandler},
}
}

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 6eb96c9

Please sign in to comment.