Skip to content

Commit

Permalink
feat: migrate x/distribution to use app wiring (cosmos#12294)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Jun 17, 2022
1 parent 7aa0f3c commit ee05d7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 1 addition & 7 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,14 @@ func NewSimApp(
&app.SlashingKeeper,
&app.MintKeeper,
&app.EvidenceKeeper,
&app.DistrKeeper,
); err != nil {
panic(err)
}

app.App = appBuilder.Build(logger, db, traceStore, baseAppOptions...)

app.keys = sdk.NewKVStoreKeys(
distrtypes.StoreKey,
govtypes.StoreKey,
upgradetypes.StoreKey,
)
Expand All @@ -246,10 +246,6 @@ func NewSimApp(

initParamsKeeper(app.ParamsKeeper)

app.DistrKeeper = distrkeeper.NewKeeper(
app.appCodec, app.keys[distrtypes.StoreKey], app.GetSubspace(distrtypes.ModuleName), app.AccountKeeper, app.BankKeeper,
app.StakingKeeper, authtypes.FeeCollectorName,
)
app.CrisisKeeper = crisiskeeper.NewKeeper(
app.GetSubspace(crisistypes.ModuleName), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName,
)
Expand Down Expand Up @@ -294,7 +290,6 @@ func NewSimApp(
vesting.NewAppModule(app.AccountKeeper, app.BankKeeper),
crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants),
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),
); err != nil {
panic(err)
Expand Down Expand Up @@ -451,7 +446,6 @@ func GetMaccPerms() map[string][]string {

// initParamsKeeper init params keeper and its subspaces
func initParamsKeeper(paramsKeeper paramskeeper.Keeper) {
paramsKeeper.Subspace(distrtypes.ModuleName)
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable())
paramsKeeper.Subspace(crisistypes.ModuleName)
}
6 changes: 5 additions & 1 deletion app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ modules:
"@type": cosmos.group.v1.module.v1.Module
max_metadata_len: 255
max_execution_period: "1209600s"

- name: nft
config:
"@type": cosmos.nft.module.v1.Module
Expand All @@ -129,3 +129,7 @@ modules:
- name: evidence
config:
"@type": cosmos.evidence.module.v1.Module

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

0 comments on commit ee05d7d

Please sign in to comment.