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 9cd0efb commit 8a05a69
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/upgrades/drs-2/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ func CreateUpgradeHandler(
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// upgrade drs to 2
err := rpKeeper.SetVersion(ctx, uint32(2))
if err != nil {
if err := rpKeeper.SetVersion(ctx, uint32(2)); err != nil {
return nil, err
}

Expand All @@ -35,16 +34,15 @@ func HandleUpgrade(
evmKeeper *evmkeeper.Keeper,
) error {
// migrate rollapp params with missing min-gas-prices
err := rpKeeper.SetMinGasPrices(ctx, rollappparamstypes.DefaultParams().MinGasPrices)
if err != nil {
if err := rpKeeper.SetMinGasPrices(ctx, rollappparamstypes.DefaultParams().MinGasPrices); err != nil {
return err
}

// migrate evm params with missing gasDenom
evmParams := evmKeeper.GetParams(ctx)
evmParams.GasDenom = evmParams.EvmDenom

if err = evmKeeper.SetParams(ctx, evmParams); err != nil {
if err := evmKeeper.SetParams(ctx, evmParams); err != nil {
return err
}

Expand Down

0 comments on commit 8a05a69

Please sign in to comment.