Last active
July 5, 2022 01:07
-
-
Save zeroFruit/d3dea474fdf6a24b6f2c4b68577ab5f2 to your computer and use it in GitHub Desktop.
Cosmos Dev Series: Cosmos-SDK-based Blockchain Upgrade - SimApp setup upgrade handler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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