From 4e50756b558c7697f09f1e717ac01593656546ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Kunze=20K=C3=BCllmer?= <31522760+fedekunze@users.noreply.github.com> Date: Wed, 8 Jun 2022 16:24:21 +0200 Subject: [PATCH] fix(upgrades): perform no-op if 'from' and 'to' migration version are equal (#12174) --- types/module/configurator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/module/configurator.go b/types/module/configurator.go index c0b25a82e970..811fb51996d5 100644 --- a/types/module/configurator.go +++ b/types/module/configurator.go @@ -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 }