Skip to content

Commit

Permalink
chore(app/upgrades): set app version correctly for v11 (#2071)
Browse files Browse the repository at this point in the history
* chore(app/upgrades): set app version correctly for v11

* lint
  • Loading branch information
p0mvn authored Jul 18, 2022
1 parent 3631925 commit 1a99255
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/upgrades/v11/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,24 @@ import (
"github.com/osmosis-labs/osmosis/v7/app/upgrades"
)

// We set the app version to pre-upgrade because it will be incremented by one
// after the upgrade is applied by the handler.
const preUpgradeAppVersion = 10

func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
bpm upgrades.BaseAppParamManager,
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// Although the app version was already set during the v9 upgrade, our v10 was a fork.
// As a result, the upgrade handler was not executed to increment the app version.
// This change helps to correctly set the app version for v11.
if err := keepers.UpgradeKeeper.SetAppVersion(ctx, preUpgradeAppVersion); err != nil {
return nil, err
}

return mm.RunMigrations(ctx, configurator, fromVM)
}
}

0 comments on commit 1a99255

Please sign in to comment.