Skip to content

Commit

Permalink
chore: initialize AllowedDenoms in migration
Browse files Browse the repository at this point in the history
  • Loading branch information
johnletey committed May 14, 2024
1 parent 1ba13ab commit 172acc0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions x/forwarding/keeper/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,21 @@ func NewMigrator(keeper *Keeper) Migrator {
func (m Migrator) Migrate1to2(ctx sdk.Context) error {
adapter := runtime.KVStoreAdapter(m.keeper.storeService.OpenKVStore(ctx))

// AllowedDenoms were introduced in v2, so we initialize with a wildcard.
err := m.keeper.AllowedDenoms.Set(ctx, "*")
if err != nil {
return err
}

// Migrate NumOfAccounts from v1 to v2 state.
for channel, count := range v1.GetAllNumOfAccounts(adapter) {
err := m.keeper.NumOfAccounts.Set(ctx, channel, count)
if err != nil {
return err
}
}

// Migrate NumOfForwards from v1 to v2 state.
for channel, count := range v1.GetAllNumOfForwards(adapter) {
err := m.keeper.NumOfForwards.Set(ctx, channel, count)
if err != nil {
Expand Down

0 comments on commit 172acc0

Please sign in to comment.