mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 00:05:18 +00:00
fix: define gov router after committee keeper (#1223)
This commit is contained in:
parent
bbb2235ba0
commit
6ad85f09b7
37
app/app.go
37
app/app.go
@ -521,24 +521,6 @@ func NewApp(
|
||||
),
|
||||
)
|
||||
|
||||
govRouter := govtypes.NewRouter()
|
||||
govRouter.
|
||||
AddRoute(govtypes.RouterKey, govtypes.ProposalHandler).
|
||||
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.paramsKeeper)).
|
||||
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.upgradeKeeper)).
|
||||
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.ibcKeeper.ClientKeeper)).
|
||||
AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.distrKeeper)).AddRoute(kavadisttypes.RouterKey, kavadist.NewCommunityPoolMultiSpendProposalHandler(app.kavadistKeeper)).
|
||||
AddRoute(committeetypes.RouterKey, committee.NewProposalHandler(app.committeeKeeper))
|
||||
app.govKeeper = govkeeper.NewKeeper(
|
||||
appCodec,
|
||||
keys[govtypes.StoreKey],
|
||||
govSubspace,
|
||||
app.accountKeeper,
|
||||
app.bankKeeper,
|
||||
&app.stakingKeeper,
|
||||
govRouter,
|
||||
)
|
||||
|
||||
app.transferKeeper = ibctransferkeeper.NewKeeper(
|
||||
appCodec,
|
||||
keys[ibctransfertypes.StoreKey],
|
||||
@ -647,6 +629,25 @@ func NewApp(
|
||||
app.accountKeeper,
|
||||
app.bankKeeper,
|
||||
)
|
||||
// create gov keeper with router
|
||||
// NOTE this must be done after any keepers referenced in the gov router (ie committee) are defined
|
||||
govRouter := govtypes.NewRouter()
|
||||
govRouter.
|
||||
AddRoute(govtypes.RouterKey, govtypes.ProposalHandler).
|
||||
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.paramsKeeper)).
|
||||
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.upgradeKeeper)).
|
||||
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.ibcKeeper.ClientKeeper)).
|
||||
AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.distrKeeper)).AddRoute(kavadisttypes.RouterKey, kavadist.NewCommunityPoolMultiSpendProposalHandler(app.kavadistKeeper)).
|
||||
AddRoute(committeetypes.RouterKey, committee.NewProposalHandler(app.committeeKeeper))
|
||||
app.govKeeper = govkeeper.NewKeeper(
|
||||
appCodec,
|
||||
keys[govtypes.StoreKey],
|
||||
govSubspace,
|
||||
app.accountKeeper,
|
||||
app.bankKeeper,
|
||||
&app.stakingKeeper,
|
||||
govRouter,
|
||||
)
|
||||
|
||||
// register the staking hooks
|
||||
// NOTE: These keepers are passed by reference above, so they will contain these hooks.
|
||||
|
Loading…
Reference in New Issue
Block a user