Skip to content

Commit

Permalink
Backport part of cosmos#1653
Browse files Browse the repository at this point in the history
  • Loading branch information
ulbqb committed Jul 26, 2023
1 parent 48a6ae5 commit 98264a9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 298 deletions.
18 changes: 2 additions & 16 deletions modules/core/02-client/client/proposal_handler.go
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
package client

import (
"net/http"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/types/rest"
govclient "github.com/cosmos/cosmos-sdk/x/gov/client"
govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest"

"github.com/cosmos/ibc-go/v4/modules/core/02-client/client/cli"
)

var (
UpdateClientProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitUpdateClientProposal, emptyRestHandler)
UpgradeProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitUpgradeProposal, emptyRestHandler)
UpdateClientProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitUpdateClientProposal)
UpgradeProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitUpgradeProposal)
)

func emptyRestHandler(client.Context) govrest.ProposalRESTHandler {
return govrest.ProposalRESTHandler{
SubRoute: "unsupported-ibc-client",
Handler: func(w http.ResponseWriter, r *http.Request) {
rest.WriteErrorResponse(w, http.StatusBadRequest, "Legacy REST Routes are not supported for IBC proposals")
},
}
}
279 changes: 0 additions & 279 deletions testing/sdk_test.go

This file was deleted.

3 changes: 0 additions & 3 deletions testing/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"github.com/cosmos/cosmos-sdk/version"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
Expand Down Expand Up @@ -760,8 +759,6 @@ func (app *SimApp) SimulationManager() *module.SimulationManager {
func (app *SimApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
clientCtx := apiSvr.ClientCtx
rpc.RegisterRoutes(clientCtx, apiSvr.Router)
// Register legacy tx routes.
authrest.RegisterTxRoutes(clientCtx, apiSvr.Router)
// Register new tx routes from grpc-gateway.
authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
// Register new tendermint queries routes from grpc-gateway.
Expand Down

0 comments on commit 98264a9

Please sign in to comment.