Skip to content

Instantly share code, notes, and snippets.

@zeroFruit
Created July 5, 2022 00:40
Show Gist options
  • Save zeroFruit/22daf2c5d9c8bc71fbd2e498ff140ce0 to your computer and use it in GitHub Desktop.
Save zeroFruit/22daf2c5d9c8bc71fbd2e498ff140ce0 to your computer and use it in GitHub Desktop.
Cosmos Dev Series: Cosmos-SDK-based Blockchain Upgrade - NewSimApp x/gov handler
func NewSimApp(...) *SimApp {
...
// register the proposal types
govRouter := govtypes.NewRouter()
govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler).
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper))
govKeeper := govkeeper.NewKeeper(
appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper,
&stakingKeeper, govRouter,
)
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment