From ce53635a8f372398d2f5f1025cf81d3a5a36f6a8 Mon Sep 17 00:00:00 2001 From: Ajaz Ahmed Ansari Date: Wed, 15 Mar 2023 23:22:38 +0530 Subject: [PATCH] fix: upgrade handler (#352) * refactor upgrade handler * add changelog --- CHANGELOG.md | 3 +++ app/upgrades.go | 6 +++--- app/upgrades_test.go | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 735fd8b0f..2f82667e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Released +### v1.2.7 +- fix upgrade handler + ### v1.2.6 - fix release height diff --git a/app/upgrades.go b/app/upgrades.go index 7880da2b0..b5e0232d1 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -18,14 +18,14 @@ const ( DevnetChainID = "quicktest-1" v010204UpgradeName = "v1.2.4" - v010205UpgradeName = "v1.2.5" + v010207UpgradeName = "v1.2.7" v010300UpgradeName = "v1.3.0" // retained for testy ) func setUpgradeHandlers(app *Quicksilver) { app.UpgradeKeeper.SetUpgradeHandler(v010300UpgradeName, noOpUpgradeHandler(app)) // retained for testy app.UpgradeKeeper.SetUpgradeHandler(v010204UpgradeName, v010204UpgradeHandler(app)) - app.UpgradeKeeper.SetUpgradeHandler(v010205UpgradeName, v010205UpgradeHandler(app)) + app.UpgradeKeeper.SetUpgradeHandler(v010207UpgradeName, v010207UpgradeHandler(app)) // When a planned update height is reached, the old binary will panic // writing on disk the height and name of the update that triggered it @@ -83,7 +83,7 @@ func v010204UpgradeHandler(app *Quicksilver) upgradetypes.UpgradeHandler { } } -func v010205UpgradeHandler(app *Quicksilver) upgradetypes.UpgradeHandler { +func v010207UpgradeHandler(app *Quicksilver) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { // update minter epoch-provisions minter := app.MintKeeper.GetMinter(ctx) diff --git a/app/upgrades_test.go b/app/upgrades_test.go index 468f48c88..643528047 100644 --- a/app/upgrades_test.go +++ b/app/upgrades_test.go @@ -278,9 +278,9 @@ func (suite *AppTestSuite) initTestZone() { } } -func (s *AppTestSuite) TestV010205UpgradeHandler() { +func (s *AppTestSuite) TestV010207UpgradeHandler() { app := s.GetQuicksilverApp(s.chainA) - handler := v010205UpgradeHandler(app) + handler := v010207UpgradeHandler(app) ctx := s.chainA.GetContext() expectedVal := sdk.NewDec(50_000_000_000_000).Quo(sdk.NewDec(365))