Skip to content

Instantly share code, notes, and snippets.

@zeroFruit
Last active July 5, 2022 01:07
Show Gist options
  • Save zeroFruit/d3dea474fdf6a24b6f2c4b68577ab5f2 to your computer and use it in GitHub Desktop.
Save zeroFruit/d3dea474fdf6a24b6f2c4b68577ab5f2 to your computer and use it in GitHub Desktop.
Cosmos Dev Series: Cosmos-SDK-based Blockchain Upgrade - SimApp setup upgrade handler
package app // app.go
func NewSimApp(...) *SimApp {
// setupUpgradeHandlers should be called before `LoadLatestVersion()`
// because StoreLoad is sealed after that
app.setupUpgradeHandlers(configurator, app.BankKeeper)
if loadLatest {
if err := app.LoadLatestVersion(); err != nil {
tmos.Exit(err.Error())
}
}
...
return app
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment