Skip to content

Commit b2c3f50

Browse files
authored
Remove the tokenfactory governance route (#4431)
The gov router registers a `tokenfactory` route whose handler, `tokenfactory.NewProposalHandler`, rejects every proposal with "unrecognized tokenfactory proposal content type". Tokenfactory registers no `govtypes.Content` implementations and no content type anywhere in the tree returns `tokenfactory` from `ProposalRoute()`, so no proposal can ever be submitted to or executed through this route. It is dead wiring left over from the upstream module. This drops the `AddRoute(tokenfactorytypes.RouterKey, ...)` call in `app.New` and deletes `x/tokenfactory/handler.go`. Tokenfactory messages, keeper and state are untouched. The gov router is not state. Gov only consults it in `SubmitProposal` (`HasRoute`) and when executing a passed proposal (`GetRoute`, which panics on a missing route), and both depend on the proposal's content type, which cannot point at `tokenfactory`. So this is not app-hash breaking and needs no upgrade handler. Validated with `go vet`, golangci-lint and `go test` on `app` and `x/tokenfactory`.
1 parent a16e685 commit b2c3f50

2 files changed

Lines changed: 0 additions & 16 deletions

File tree

‎app/app.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,6 @@ func New(
773773
AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)).
774774
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
775775
AddRoute(minttypes.RouterKey, mint.NewProposalHandler(app.MintKeeper)).
776-
AddRoute(tokenfactorytypes.RouterKey, tokenfactorymodule.NewProposalHandler(app.TokenFactoryKeeper)).
777776
AddRoute(evmtypes.RouterKey, evm.ProposalHandler)
778777
if len(enabledProposals) != 0 {
779778
govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, enabledProposals))

‎x/tokenfactory/handler.go‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)