Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: remove legacy handler #9650

Merged
merged 16 commits into from Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -58,6 +58,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [\#9594](https://github.com/cosmos/cosmos-sdk/pull/9594) `types/rest` package moved to `testutil/rest`.
* [\#9432](https://github.com/cosmos/cosmos-sdk/pull/9432) `ConsensusParamsKeyTable` moved from `params/keeper` to `params/types`
* [\#9576](https://github.com/cosmos/cosmos-sdk/pull/9576) Add debug error message to `sdkerrors.QueryResult` when enabled
* [\#9650](https://github.com/cosmos/cosmos-sdk/pull/9650) Removed deprecated message handler implementation from the SDK modules.

### Client Breaking Changes

Expand Down
6 changes: 4 additions & 2 deletions x/auth/module.go
Expand Up @@ -111,8 +111,10 @@ func (AppModule) Name() string {
// RegisterInvariants performs a no-op.
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}

// Route returns the message routing key for the auth module.
func (AppModule) Route() sdk.Route { return sdk.Route{} }
// Deprecated: Route returns the message routing key for the auth module.
func (AppModule) Route() sdk.Route {
return sdk.Route{}
}

// QuerierRoute returns the auth module's querier route name.
func (AppModule) QuerierRoute() string {
Expand Down
26 changes: 0 additions & 26 deletions x/auth/vesting/handler.go

This file was deleted.

97 changes: 0 additions & 97 deletions x/auth/vesting/handler_test.go

This file was deleted.

4 changes: 2 additions & 2 deletions x/auth/vesting/module.go
Expand Up @@ -92,9 +92,9 @@ func NewAppModule(ak keeper.AccountKeeper, bk types.BankKeeper) AppModule {
// RegisterInvariants performs a no-op; there are no invariants to enforce.
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}

// Route returns the module's message router and handler.
// Deprecated: Route returns the module's message router and handler.
func (am AppModule) Route() sdk.Route {
return sdk.NewRoute(types.RouterKey, NewHandler(am.accountKeeper, am.bankKeeper))
return sdk.Route{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we panic instead with a clear message "this method is deprecated and not implemented by the SDK anymore" ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah returning just sdk.Route{} seems like it could lead to errors possibly? I'd recommend doing anything we can to encourage developers to not use deprecated functionality and panicing seems OK to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding panic is breaking RegisterRoutes. We are not registering empty router, I think returning sdk.Route{} is fine.

}

// QuerierRoute returns an empty string as the module contains no query
Expand Down
4 changes: 2 additions & 2 deletions x/authz/module/module.go
Expand Up @@ -117,9 +117,9 @@ func (AppModule) Name() string {
// RegisterInvariants does nothing, there are no invariants to enforce
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}

// Route returns the message routing key for the staking module.
// Deprecated: Route returns the message routing key for the authz module.
func (am AppModule) Route() sdk.Route {
return sdk.NewRoute(authz.RouterKey, nil)
return sdk.Route{}
}

func (am AppModule) NewHandler() sdk.Handler {
Expand Down
30 changes: 0 additions & 30 deletions x/bank/handler.go

This file was deleted.

88 changes: 0 additions & 88 deletions x/bank/handler_test.go

This file was deleted.

4 changes: 2 additions & 2 deletions x/bank/module.go
Expand Up @@ -123,9 +123,9 @@ func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
keeper.RegisterInvariants(ir, am.keeper)
}

// Route returns the message routing key for the bank module.
// Deprecated: Route returns the message routing key for the bank module.
func (am AppModule) Route() sdk.Route {
return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper))
return sdk.Route{}
}

// QuerierRoute returns the bank module's querier route name.
Expand Down
6 changes: 4 additions & 2 deletions x/capability/module.go
Expand Up @@ -103,8 +103,10 @@ func (am AppModule) Name() string {
return am.AppModuleBasic.Name()
}

// Route returns the capability module's message routing key.
func (AppModule) Route() sdk.Route { return sdk.Route{} }
// Deprecated: Route returns the capability module's message routing key.
func (AppModule) Route() sdk.Route {
return sdk.Route{}
}

// QuerierRoute returns the capability module's query routing key.
func (AppModule) QuerierRoute() string { return "" }
Expand Down
25 changes: 0 additions & 25 deletions x/crisis/handler.go

This file was deleted.