Skip to content

Commit

Permalink
chore: add default upgrade handler for v8.1 (#5636)
Browse files Browse the repository at this point in the history
  • Loading branch information
damiannolan authored Jan 17, 2024
1 parent 6fc8159 commit c5d8472
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
10 changes: 9 additions & 1 deletion testing/simapp/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand Down
9 changes: 2 additions & 7 deletions testing/simapp/upgrades/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}

0 comments on commit c5d8472

Please sign in to comment.