mirror of
https://github.com/0glabs/0g-chain.git
synced 2025-01-13 16:55:17 +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(
|
app.transferKeeper = ibctransferkeeper.NewKeeper(
|
||||||
appCodec,
|
appCodec,
|
||||||
keys[ibctransfertypes.StoreKey],
|
keys[ibctransfertypes.StoreKey],
|
||||||
@ -647,6 +629,25 @@ func NewApp(
|
|||||||
app.accountKeeper,
|
app.accountKeeper,
|
||||||
app.bankKeeper,
|
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
|
// register the staking hooks
|
||||||
// NOTE: These keepers are passed by reference above, so they will contain these hooks.
|
// NOTE: These keepers are passed by reference above, so they will contain these hooks.
|
||||||
|
Loading…
Reference in New Issue
Block a user