From 89845bf452f9dd2685e1c04c6fd016ed781c454f Mon Sep 17 00:00:00 2001 From: Joe Bowman Date: Tue, 19 Nov 2024 14:44:13 +0000 Subject: [PATCH] move prod upgrade handler to v1.7.2; remove additional stargaze txs --- app/upgrades/types.go | 1 + app/upgrades/upgrades.go | 1 + app/upgrades/v1_7.go | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/app/upgrades/types.go b/app/upgrades/types.go index 051cb3b7f..cc3e72469 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -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 diff --git a/app/upgrades/upgrades.go b/app/upgrades/upgrades.go index 0f8102b50..109d96369 100644 --- a/app/upgrades/upgrades.go +++ b/app/upgrades/upgrades.go @@ -25,6 +25,7 @@ func Upgrades() []Upgrade { {UpgradeName: V010603UpgradeName, CreateUpgradeHandler: V010603UpgradeHandler}, {UpgradeName: V010604UpgradeName, CreateUpgradeHandler: V010604UpgradeHandler}, {UpgradeName: V010700UpgradeName, CreateUpgradeHandler: V010700UpgradeHandler}, + {UpgradeName: V010702UpgradeName, CreateUpgradeHandler: V010702UpgradeHandler}, } } diff --git a/app/upgrades/v1_7.go b/app/upgrades/v1_7.go index eeeec3e38..942c4b691 100644 --- a/app/upgrades/v1_7.go +++ b/app/upgrades/v1_7.go @@ -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) { @@ -22,6 +32,8 @@ 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. @@ -29,15 +41,28 @@ func V010700UpgradeHandler( 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