Skip to content

Commit

Permalink
feat: migrate x/evidence to use app wiring (cosmos#12240)
Browse files Browse the repository at this point in the history
## Description

Implements 2/3 of cosmos#12238



---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [x] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [x] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [x] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
  • Loading branch information
julienrbrt authored Jun 13, 2022
1 parent 18a2cdc commit 7a004b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 1 addition & 9 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ func NewSimApp(
&app.NFTKeeper,
&app.SlashingKeeper,
&app.MintKeeper,
&app.EvidenceKeeper,
&msgServiceRouter,
); err != nil {
panic(err)
Expand All @@ -238,7 +239,6 @@ func NewSimApp(
distrtypes.StoreKey,
govtypes.StoreKey,
upgradetypes.StoreKey,
evidencetypes.StoreKey,
group.StoreKey,
)
// NOTE: The testingkey is just mounted for testing purposes. Actual applications should
Expand Down Expand Up @@ -296,13 +296,6 @@ func NewSimApp(
// set the governance module account as the authority for conducting upgrades
app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, app.keys[upgradetypes.StoreKey], app.appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String())

// create evidence keeper with router
evidenceKeeper := evidencekeeper.NewKeeper(
app.appCodec, app.keys[evidencetypes.StoreKey], app.StakingKeeper, app.SlashingKeeper,
)
// If evidence needs to be handled for the app, set routes in router here and seal
app.EvidenceKeeper = *evidenceKeeper

/**** Module Options ****/

// NOTE: we may consider parsing `appOpts` inside module constructors. For the moment
Expand All @@ -317,7 +310,6 @@ func NewSimApp(
gov.NewAppModule(app.appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper),
distr.NewAppModule(app.appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
upgrade.NewAppModule(app.UpgradeKeeper),
evidence.NewAppModule(app.EvidenceKeeper),
groupmodule.NewAppModule(app.appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
); err != nil {
panic(err)
Expand Down
4 changes: 4 additions & 0 deletions app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,7 @@ modules:
- name: mint
config:
"@type": cosmos.mint.module.v1.Module

- name: evidence
config:
"@type": cosmos.evidence.module.v1.Module

0 comments on commit 7a004b9

Please sign in to comment.