Skip to content

Commit

Permalink
move prod upgrade handler to v1.7.2; remove additional stargaze txs
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-bowman committed Nov 19, 2024
1 parent f11e862 commit 89845bf
Show file tree
Hide file tree
Showing 3 changed files with 27 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 @@ -50,6 +50,7 @@ const (
V010604UpgradeName = "v1.6.4"

V010700UpgradeName = "v1.7.0"
V010702UpgradeName = "v1.7.2"
)

// Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal
Expand Down
1 change: 1 addition & 0 deletions app/upgrades/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func Upgrades() []Upgrade {
{UpgradeName: V010603UpgradeName, CreateUpgradeHandler: V010603UpgradeHandler},
{UpgradeName: V010604UpgradeName, CreateUpgradeHandler: V010604UpgradeHandler},
{UpgradeName: V010700UpgradeName, CreateUpgradeHandler: V010700UpgradeHandler},
{UpgradeName: V010702UpgradeName, CreateUpgradeHandler: V010702UpgradeHandler},
}
}

Expand Down
25 changes: 25 additions & 0 deletions app/upgrades/v1_7.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ func V010700UpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
appKeepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return mm.RunMigrations(ctx, configurator, fromVM)
}
}

func V010702UpgradeHandler(
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 isMainnet(ctx) || isTest(ctx) {
Expand All @@ -22,22 +32,37 @@ func V010700UpgradeHandler(
Hash string
}{
{Zone: "cosmoshub-4", Hash: "0c8269f04109a55a152d3cdfd22937b4e5c2746111d579935eef4cd7ffa71f7f"},
{Zone: "stargaze-1", Hash: "10af0ee10a97f01467039a69cbfb8df05dc3111c975d955ca51adda201f36555"},
{Zone: "stargaze-1", Hash: "0000000000000000000000000000000000000000000000000000000000000577"},
}
for _, hashRecord := range hashes {
// delete duplicate records.
appKeepers.InterchainstakingKeeper.DeleteWithdrawalRecord(ctx, hashRecord.Zone, hashRecord.Hash, icstypes.WithdrawStatusUnbond)
appKeepers.InterchainstakingKeeper.Logger(ctx).Info("delete duplicate withdrawal record", "hash", hashRecord.Hash, "zone", hashRecord.Zone)
}

// mint 50.699994 uqatom into escrow account
err := appKeepers.BankKeeper.MintCoins(ctx, icstypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uqatom", sdk.NewInt(50699994))))
if err != nil {
panic(err)
}

err = appKeepers.BankKeeper.SendCoinsFromModuleToModule(ctx, icstypes.ModuleName, icstypes.EscrowModuleAccount, sdk.NewCoins(sdk.NewCoin("uqatom", sdk.NewInt(50699994))))
if err != nil {
panic(err)
}

// burn 16463.524950 qstars from escrow account
err = appKeepers.BankKeeper.SendCoinsFromModuleToModule(ctx, icstypes.EscrowModuleAccount, icstypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uqstars", sdk.NewInt(16463524950))))
if err != nil {
panic(err)
}

err = appKeepers.BankKeeper.BurnCoins(ctx, icstypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uqstars", sdk.NewInt(16463524950))))
if err != nil {
panic(err)
}

appKeepers.InterchainstakingKeeper.IterateZones(ctx, func(index int64, zone *icstypes.Zone) (stop bool) {
appKeepers.InterchainstakingKeeper.OverrideRedemptionRateNoCap(ctx, zone)
return false
Expand Down

0 comments on commit 89845bf

Please sign in to comment.