Skip to content

Commit

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

Implements 2/3 from cosmos#12234



---

### 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)
- [x] 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)
- [ ] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [ ] 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 d1c6ff7 commit 18a2cdc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 4 additions & 8 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ func NewSimApp(
&app.StakingKeeper,
&app.NFTKeeper,
&app.SlashingKeeper,
&app.MintKeeper,
&msgServiceRouter,
); err != nil {
panic(err)
Expand All @@ -234,8 +235,9 @@ func NewSimApp(
app.App = appBuilder.Build(logger, db, traceStore, msgServiceRouter, baseAppOptions...)

app.keys = sdk.NewKVStoreKeys(
minttypes.StoreKey, distrtypes.StoreKey,
govtypes.StoreKey, upgradetypes.StoreKey,
distrtypes.StoreKey,
govtypes.StoreKey,
upgradetypes.StoreKey,
evidencetypes.StoreKey,
group.StoreKey,
)
Expand All @@ -251,10 +253,6 @@ func NewSimApp(

initParamsKeeper(app.ParamsKeeper)

app.MintKeeper = mintkeeper.NewKeeper(
app.appCodec, app.keys[minttypes.StoreKey], app.GetSubspace(minttypes.ModuleName), app.StakingKeeper,
app.AccountKeeper, app.BankKeeper, authtypes.FeeCollectorName,
)
app.DistrKeeper = distrkeeper.NewKeeper(
app.appCodec, app.keys[distrtypes.StoreKey], app.GetSubspace(distrtypes.ModuleName), app.AccountKeeper, app.BankKeeper,
app.StakingKeeper, authtypes.FeeCollectorName,
Expand Down Expand Up @@ -317,7 +315,6 @@ func NewSimApp(
vesting.NewAppModule(app.AccountKeeper, app.BankKeeper),
crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants),
gov.NewAppModule(app.appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper),
mint.NewAppModule(app.appCodec, app.MintKeeper, app.AccountKeeper, nil),
distr.NewAppModule(app.appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
upgrade.NewAppModule(app.UpgradeKeeper),
evidence.NewAppModule(app.EvidenceKeeper),
Expand Down Expand Up @@ -503,7 +500,6 @@ func GetMaccPerms() map[string][]string {

// initParamsKeeper init params keeper and its subspaces
func initParamsKeeper(paramsKeeper paramskeeper.Keeper) {
paramsKeeper.Subspace(minttypes.ModuleName)
paramsKeeper.Subspace(distrtypes.ModuleName)
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable())
paramsKeeper.Subspace(crisistypes.ModuleName)
Expand Down
4 changes: 4 additions & 0 deletions app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,7 @@ modules:
- name: genutil
config:
"@type": cosmos.genutil.module.v1.Module

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

0 comments on commit 18a2cdc

Please sign in to comment.