From 28c08ad4a7d52f21976319a73bfb94615194fb71 Mon Sep 17 00:00:00 2001 From: Duong Minh Ngoc Date: Tue, 27 Feb 2024 10:43:10 +0700 Subject: [PATCH] avoid deterministic iteration --- app/upgrades/account_migrations.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/upgrades/account_migrations.go b/app/upgrades/account_migrations.go index ee2a4b442..39f188026 100644 --- a/app/upgrades/account_migrations.go +++ b/app/upgrades/account_migrations.go @@ -9,6 +9,7 @@ import ( vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" "github.com/quicksilver-zone/quicksilver/app/keepers" + "github.com/quicksilver-zone/quicksilver/utils" "github.com/quicksilver-zone/quicksilver/utils/addressutils" ) @@ -25,7 +26,9 @@ func migrateIngenuityMultisigToNotional(ctx sdk.Context, appKeepers *keepers.App // Migrate a map of address pairs and migrate from key -> value func migrateVestingAccounts(ctx sdk.Context, appKeepers *keepers.AppKeepers, migrations map[string]string, strategy ProcessMigrateAccountStrategy) error { - for fromBech32, toBech32 := range migrations { + for _, fromBech32 := range utils.Keys(migrations) { + toBech32 := migrations[fromBech32] + from, err := addressutils.AccAddressFromBech32(fromBech32, "quick") if err != nil { return err