Skip to content

Commit

Permalink
move load latest app version later to avoid sealing the app
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-nguy committed Jan 3, 2022
1 parent cec3050 commit a1aa07a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,16 +713,6 @@ func New(

app.SetEndBlocker(app.EndBlocker)

if loadLatest {
if err := app.LoadLatestVersion(); err != nil {
tmos.Exit(err.Error())
}
}

app.ScopedIBCKeeper = scopedIBCKeeper
app.ScopedTransferKeeper = scopedTransferKeeper
// this line is used by starport scaffolding # stargate/app/beforeInitReturn

// upgrade handler
plan0_7_0 := "v0.7.0"
app.UpgradeKeeper.SetUpgradeHandler(plan0_7_0, func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
Expand All @@ -745,6 +735,16 @@ func New(
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
}

if loadLatest {
if err := app.LoadLatestVersion(); err != nil {
tmos.Exit(err.Error())
}
}

app.ScopedIBCKeeper = scopedIBCKeeper
app.ScopedTransferKeeper = scopedTransferKeeper
// this line is used by starport scaffolding # stargate/app/beforeInitReturn

return app
}

Expand Down

0 comments on commit a1aa07a

Please sign in to comment.