Skip to content

Commit

Permalink
change migration order
Browse files Browse the repository at this point in the history
  • Loading branch information
ramacarlucho committed Apr 29, 2024
1 parent 481641a commit ee637b3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 5 additions & 3 deletions app/upgrades/v20/convert.go
Expand Up @@ -26,8 +26,10 @@ import (
)

// storeKey contains the slot in which the balance is stored in the evm.
var storeKey []byte = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2}
var storeKeyWevmos []byte = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3}
var (
storeKey []byte = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2}
storeKeyWevmos []byte = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3}
)

type parseTokenPairs = []common.Address

Expand Down Expand Up @@ -123,7 +125,7 @@ func ConvertERC20Coins(
}

modifiedBalancesAccounts := erc20Keeper.GetAllSTRV2Address(ctx)
var modifiedBalancesWallets = make([]string, len(modifiedBalancesAccounts))
modifiedBalancesWallets := make([]string, len(modifiedBalancesAccounts))
for i, addr := range modifiedBalancesAccounts {
modifiedBalancesWallets[i] = addr.String()
}
Expand Down
3 changes: 2 additions & 1 deletion app/upgrades/v20/fixes/missingWallets.go
Expand Up @@ -119,7 +119,8 @@ func GetAllMissingWallets() []string {
}

func GetMissingWalletsFromAuthModule(ctx sdk.Context,
accountKeeper authkeeper.AccountKeeper) (Addresses []string) {
accountKeeper authkeeper.AccountKeeper,
) (Addresses []string) {
missingWallets := GetAllMissingWallets()
for _, wallet := range missingWallets {
ethAddr := common.HexToAddress(wallet)
Expand Down
7 changes: 6 additions & 1 deletion app/upgrades/v20/upgrades.go
Expand Up @@ -32,6 +32,11 @@ func CreateUpgradeHandler(
logger.Debug("deleting revenue module from version map...")
delete(vm, "revenue")

uvm, err := mm.RunMigrations(ctx, configurator, vm)
if err != nil {
return uvm, err
}

// Leave modules as-is to avoid running InitGenesis.
// Get EVM denomination
evmDenom := ek.GetParams(ctx).EvmDenom
Expand Down Expand Up @@ -72,6 +77,6 @@ func CreateUpgradeHandler(

// Leave modules are as-is to avoid running InitGenesis.
logger.Debug("running module migrations ...")
return mm.RunMigrations(ctx, configurator, vm)
return uvm, err
}
}

0 comments on commit ee637b3

Please sign in to comment.