Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Oct 13, 2023
1 parent 63ae124 commit 1de6e99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 4 additions & 3 deletions x/bank/keeper/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ func (m Migrator) Migrate2to3(ctx sdk.Context) error {

// Migrate3to4 migrates x/bank storage from version 3 to 4.
func (m Migrator) Migrate3to4(ctx sdk.Context) error {
m.MigrateSendEnabledParams(ctx)
return v4.MigrateStore(ctx, m.keeper.storeKey, m.legacySubspace, m.keeper.cdc)
}

// Migrate3to4WithSendEnabledParams migrates x/bank storage from version 3 to 4 with
// MigrateSendEnabledParams migrates x/bank storage from version 3 to 4 with
// the send enabled params get from x/params and update the bank params.
func (m Migrator) Migrate3to4WithSendEnabledParams(ctx sdk.Context) error {
// This function is only needed for chains having migrated from <= v0.47 to v0.47.0-5
func (m Migrator) MigrateSendEnabledParams(ctx sdk.Context) {
sendEnabled := types.GetSendEnabledParams(ctx, m.legacySubspace)
m.keeper.SetAllSendEnabled(ctx, sendEnabled)
return v4.MigrateStore(ctx, m.keeper.storeKey, m.legacySubspace, m.keeper.cdc)
}
6 changes: 0 additions & 6 deletions x/bank/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,6 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp
)
}

// MigrateSubspaceParams get send enabled params from x/params and update the bank params.
func (am AppModule) MigrateSubspaceParams(ctx sdk.Context) {
sendEnabled := types.GetSendEnabledParams(ctx, am.legacySubspace)
am.keeper.SetAllSendEnabled(ctx, sendEnabled)
}

// App Wiring Setup

func init() {
Expand Down

0 comments on commit 1de6e99

Please sign in to comment.