From 693573e9564f6cb9d048486874b5707529262748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Kunze=20K=C3=BCllmer?= <31522760+fedekunze@users.noreply.github.com> Date: Tue, 7 Jun 2022 13:57:05 +0200 Subject: [PATCH] fix(upgrades): perform no-op if 'from' and 'to' migration version are equal --- 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 }