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

This commit is contained in:
Federico Kunze Küllmer 2022-06-08 16:24:21 +02:00 committed by GitHub
parent 2094c13ecd
commit 4e50756b55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,8 +89,8 @@ func (c configurator) RegisterMigration(moduleName string, fromVersion uint64, h
// 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
}