github.com/okex/exchain@v1.8.0/libs/ibc-go/modules/core/02-client/client/proposal_handler.go (about)

     1  package client
     2  
     3  import (
     4  	cliContext "github.com/okex/exchain/libs/cosmos-sdk/client/context"
     5  	"github.com/okex/exchain/libs/cosmos-sdk/types/rest"
     6  	"github.com/okex/exchain/libs/ibc-go/modules/core/02-client/client/cli"
     7  	govclient "github.com/okex/exchain/x/gov/client"
     8  	govrest "github.com/okex/exchain/x/gov/client/rest"
     9  	"net/http"
    10  )
    11  
    12  var (
    13  	UpdateClientProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitUpdateClientProposal, emptyRestHandler)
    14  )
    15  
    16  func emptyRestHandler(ctx cliContext.CLIContext) govrest.ProposalRESTHandler {
    17  	return govrest.ProposalRESTHandler{
    18  		SubRoute: "unsupported-ibc-client",
    19  		Handler: func(w http.ResponseWriter, r *http.Request) {
    20  			rest.WriteErrorResponse(w, http.StatusBadRequest, "Legacy REST Routes are not supported for IBC proposals")
    21  		},
    22  	}
    23  }