Skip to content

Commit

Permalink
add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Dec 11, 2024
1 parent a620991 commit 4462cba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions x/fungible/keeper/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ func NewMigrator(keeper Keeper) Migrator {

// Migrate2to3 migrates the store from consensus version 2 to 3
func (m Migrator) Migrate2to3(ctx sdk.Context) error {
ctx.Logger().Info("Migrating fungible module from v2 to v3")
return v3.MigrateStore(ctx, m.fungibleKeeper)
}
5 changes: 4 additions & 1 deletion x/fungible/migrations/v3/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ func MigrateStore(ctx sdk.Context, fungibleKeeper fungibleKeeper) error {
fcs := fungibleKeeper.GetAllForeignCoins(ctx)
for _, fc := range fcs {
if fc.Asset != "" && crypto.IsEVMAddress(fc.Asset) && !crypto.IsChecksumAddress(fc.Asset) {
fc.Asset = crypto.ToChecksumAddress(fc.Asset)
checksumAddress := crypto.ToChecksumAddress(fc.Asset)
ctx.Logger().Info("Patching zrc20 asset", "zrc20", fc.Symbol, "old", fc.Asset, "new", checksumAddress)

fc.Asset = checksumAddress
fungibleKeeper.SetForeignCoins(ctx, fc)
}
}
Expand Down

0 comments on commit 4462cba

Please sign in to comment.