Skip to content

Commit

Permalink
set upgradehandlers for each past upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
catShaark committed Oct 9, 2023
1 parent 47b901a commit ff4d7e3
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1052,21 +1052,18 @@ func (app *MigalooApp) setupUpgradeHandlers(cfg module.Configurator) {
return
}

currentHeight := app.CommitMultiStore().LastCommitID().Version

for _, upgrade := range Upgrades {
if upgradeInfo.Name == upgrade.UpgradeName {
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &upgrade.StoreUpgrades))

Check failure on line 1057 in app/app.go

View workflow job for this annotation

GitHub Actions / lint

G601: Implicit memory aliasing in for loop. (gosec)
}
if upgradeInfo.Height == currentHeight+1 {
app.UpgradeKeeper.SetUpgradeHandler(
upgrade.UpgradeName,
upgrade.CreateUpgradeHandler(
app.mm,
cfg,
),
)
}
app.UpgradeKeeper.SetUpgradeHandler(
upgrade.UpgradeName,
upgrade.CreateUpgradeHandler(
app.mm,
cfg,
),
)

}
}

Expand Down

0 comments on commit ff4d7e3

Please sign in to comment.