Skip to content

Commit

Permalink
fix(baseapp/docs): update example
Browse files Browse the repository at this point in the history
  • Loading branch information
ziscky committed Sep 25, 2024
1 parent 89fe2cf commit 5c0e03a
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions docs/build/building-apps/06-app-go-genesis.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ func (cm CustomStakingModule) DefaultGenesis() json.RawMessage {
})
}

// option 1 ( for non depinject users ): use new module manager
moduleManager := module.NewManagerFromMap(map[string]appmodule.AppModule{
stakingtypes.ModuleName: CustomStakingModule{cdc: appCodec, AppModule: staking.NewAppModule(...)},
// other modules ...
})

// option 2 ( for depinject users ): override previous module manager
// option 1 ( for depinject users ): override previous module manager
depinject.Inject(
// ... provider/invoker/supplier
&moduleManager,
Expand All @@ -44,8 +38,12 @@ moduleManager.Modules()[stakingtypes.ModuleName] = CustomStakingModule{
cdc: appCodec,
}

// option 2 ( for non depinject users ): use new module manager
moduleManager := module.NewManagerFromMap(map[string]appmodule.AppModule{
stakingtypes.ModuleName: CustomStakingModule{cdc: appCodec, AppModule: staking.NewAppModule(...)},
// other modules ...
})



// set the module manager
app.ModuleManager = moduleManager
```

0 comments on commit 5c0e03a

Please sign in to comment.