Skip to content

Commit

Permalink
v0.2.7 upgrade (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
valli0x authored Nov 19, 2024
1 parent ab5f064 commit da411a7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ func initParamsKeeper(
func (app *App) applyUpgrades() {
app.applyUpgrade_v0_1_2()
app.applyUpgrade_v0_2_4()
app.applyUpgrade_v0_2_7()
// app.applyUpgrade_v0_2_3()
}

Expand Down
35 changes: 35 additions & 0 deletions app/upgrade_v0_2_7.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package app

import (
"context"

upgradetypes "cosmossdk.io/x/upgrade/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
)

const (
planName_v0_2_7 = "0.2.7"
)

func (app *App) applyUpgrade_v0_2_7() {
app.UpgradeKeeper.SetUpgradeHandler(planName_v0_2_7, app.upgradeHandler_v0_2_7())
}

func (app *App) upgradeHandler_v0_2_7() func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
logger := sdk.UnwrapSDKContext(ctx).Logger()

logger.Info("Starting module migrations...")

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

logger.Info("Upgrade " + plan.Name + " complete")

return vm, err
}
}

0 comments on commit da411a7

Please sign in to comment.