Skip to content

Commit

Permalink
fix: Upgrade handler bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dudong2 committed May 21, 2024
1 parent 1346a66 commit c1afd13
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,19 @@ func (app *EthermintApp) RegisterUpgradeHandlers(
func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {

Check warning on line 94 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

unused-parameter: parameter 'plan' seems to be unused, consider removing or renaming it as _ (revive)
sdkCtx := sdk.UnwrapSDKContext(ctx)

if fromVM, err := app.ModuleManager.RunMigrations(ctx, app.configurator, fromVM); err != nil {
return fromVM, err
}

// ibc v7
// OPTIONAL: prune expired tendermint consensus states to save storage space
if _, err := ibctmmigrations.PruneExpiredConsensusStates(sdkCtx, cdc, clientKeeper); err != nil {
return nil, err
return fromVM, err
}

legacyBaseAppSubspace := paramsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable())
if err := baseapp.MigrateParams(sdkCtx, legacyBaseAppSubspace, &consensusParamsKeeper.ParamsStore); err != nil {
return nil, err
return fromVM, err
}

// ibc v7.1
Expand All @@ -115,10 +119,10 @@ func (app *EthermintApp) RegisterUpgradeHandlers(
// Migrate Tendermint consensus parameters from x/params module to a dedicated x/consensus module.
err := baseapp.MigrateParams(sdkCtx, baseAppLegacySS, consensusParamsKeeper.ParamsStore)
if err != nil {
return nil, err
return fromVM, err
}

return app.ModuleManager.RunMigrations(ctx, app.configurator, fromVM)
return fromVM, err
},
)

Expand Down

0 comments on commit c1afd13

Please sign in to comment.