fix(upgrades): perform no-op if 'from' and 'to' migration version are equal (#12174) (#12192)

This commit is contained in:
mergify[bot] 2022-06-08 11:17:13 -04:00 committed by GitHub
parent 95d873faeb
commit 48c2f77a27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -89,8 +89,8 @@ func (c configurator) RegisterMigration(moduleName string, forVersion uint64, ha
// runModuleMigrations runs all in-place store migrations for one given module from a
// version to another version.
func (c configurator) runModuleMigrations(ctx sdk.Context, moduleName string, fromVersion, toVersion uint64) error {
// No-op if toVersion is the initial version.
if toVersion <= 1 {
// No-op if toVersion is the initial version or if the version is unchanged.
if toVersion <= 1 || fromVersion == toVersion {
return nil
}