Skip to content

Commit

Permalink
small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
zale144 committed Dec 16, 2024
1 parent 79443ff commit 494ed57
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/upgrades/drs-2/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ func CreateUpgradeHandler(
configurator module.Configurator,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// migrate rollapp params with missing min-gas-prices and updating drs to 2
err := rpKeeper.SetVersion(ctx, uint32(2))
if err != nil {
// upgrade drs to 2
if err := rpKeeper.SetVersion(ctx, uint32(2)); err != nil {
return nil, err
}
// first run drs-2 migration

if err := HandleUpgrade(ctx, rpKeeper); err != nil {
return nil, err
}
Expand All @@ -28,5 +27,6 @@ func CreateUpgradeHandler(
}

func HandleUpgrade(ctx sdk.Context, rpKeeper rollappparamskeeper.Keeper) error {
// migrate rollapp params with missing min-gas-prices
return rpKeeper.SetMinGasPrices(ctx, rollappparamstypes.DefaultParams().MinGasPrices)
}

0 comments on commit 494ed57

Please sign in to comment.