From 73ddc6d366ce001cf7baf8f7e6a2b5e8207385a7 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 15:45:24 +0000 Subject: [PATCH] chore: add default upgrade handler for v8.1 (#5636) (#5645) (cherry picked from commit c5d8472d24867cad7f445c8a6095f55bba2ef056) Co-authored-by: Damian Nolan --- testing/simapp/upgrades.go | 10 +++++++++- testing/simapp/upgrades/upgrades.go | 9 ++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/testing/simapp/upgrades.go b/testing/simapp/upgrades.go index 81b4902da4c..58139ee6271 100644 --- a/testing/simapp/upgrades.go +++ b/testing/simapp/upgrades.go @@ -55,7 +55,15 @@ func (app *SimApp) registerUpgradeHandlers() { app.UpgradeKeeper.SetUpgradeHandler( upgrades.V8, - upgrades.CreateV8UpgradeHandler( + upgrades.CreateDefaultUpgradeHandler( + app.ModuleManager, + app.configurator, + ), + ) + + app.UpgradeKeeper.SetUpgradeHandler( + upgrades.V8_1, + upgrades.CreateDefaultUpgradeHandler( app.ModuleManager, app.configurator, ), diff --git a/testing/simapp/upgrades/upgrades.go b/testing/simapp/upgrades/upgrades.go index ff9b6579560..03ddbb75502 100644 --- a/testing/simapp/upgrades/upgrades.go +++ b/testing/simapp/upgrades/upgrades.go @@ -32,6 +32,8 @@ const ( V7_1 = "v7.1" // V8 defines the upgrade name for the ibc-go/v8 upgrade handler. V8 = "v8" + // V8_1 defines the upgrade name for the ibc-go/v8.1 upgrade handler. + V8_1 = "v8.1" ) // CreateDefaultUpgradeHandler creates an upgrade handler which can be used for regular upgrade tests @@ -107,10 +109,3 @@ func CreateV7LocalhostUpgradeHandler( return mm.RunMigrations(ctx, configurator, vm) } } - -// CreateV8UpgradeHandler creates an upgrade handler for the ibc-go/v8 SimApp upgrade. -func CreateV8UpgradeHandler(mm *module.Manager, configurator module.Configurator) upgradetypes.UpgradeHandler { - return func(ctx context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - return mm.RunMigrations(ctx, configurator, vm) - } -}