Skip to content

Commit

Permalink
remove handler
Browse files Browse the repository at this point in the history
  • Loading branch information
rbajollari committed Oct 22, 2024
1 parent b4e96fc commit aec511f
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func (app App) RegisterUpgradeHandlers() {
app.registerUpgrade0_4_1(upgradeInfo)
app.registerUpgrade0_5_0(upgradeInfo)
app.registerUpgrade0_5_1(upgradeInfo)
app.registerUpgrade0_5_2(upgradeInfo)
}

// performs upgrade from v0.1.3 to v0.1.4
Expand Down Expand Up @@ -375,37 +374,6 @@ func (app *App) registerUpgrade0_5_1(_ upgradetypes.Plan) {
)
}

func (app *App) registerUpgrade0_5_2(_ upgradetypes.Plan) {
const planName = "v0.5.2"
app.UpgradeKeeper.SetUpgradeHandler(planName,
func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
sdkCtx := sdk.UnwrapSDKContext(ctx)
sdkCtx.Logger().Info("Upgrade handler execution", "name", planName)

// delete all payments in the store before upgrade
payments := app.GmpKeeper.GetAllPayments(sdkCtx)
for _, payment := range payments {
sdkCtx.Logger().Info("returning funds and deleting payment")
relayerAddr, err := sdk.AccAddressFromBech32(payment.Relayer)
if err != nil {
sdkCtx.Logger().Error("error getting relayer address", "error", err)
}
err = app.BankKeeper.SendCoinsFromModuleToAccount(
ctx,
gmptypes.ModuleName,
relayerAddr,
sdk.NewCoins(payment.Token),
)
if err != nil {
sdkCtx.Logger().Error("error sending coins to relayer", "error", err)
}
app.GmpKeeper.DeletePayment(sdkCtx, payment)
}
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
},
)
}

// helper function to check if the store loader should be upgraded
func (app *App) storeUpgrade(planName string, ui upgradetypes.Plan, stores storetypes.StoreUpgrades) {
if ui.Name == planName && !app.UpgradeKeeper.IsSkipHeight(ui.Height) {
Expand Down

0 comments on commit aec511f

Please sign in to comment.