-
Notifications
You must be signed in to change notification settings - Fork 39
/
proposal_handler.go
27 lines (23 loc) · 1023 Bytes
/
proposal_handler.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package client
import (
"net/http"
"github.com/classic-terra/core/x/treasury/client/cli"
"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"
)
// should we support legacy rest?
// general direction of the hub seems to be moving away from legacy rest
var (
ProposalAddBurnTaxExemptionAddressHandler = govclient.NewProposalHandler(cli.ProposalAddBurnTaxExemptionAddressCmd, emptyRestHandler)
ProposalRemoveBurnTaxExemptionAddressHandler = govclient.NewProposalHandler(cli.ProposalRemoveBurnTaxExemptionAddressCmd, emptyRestHandler)
)
func emptyRestHandler(client.Context) govrest.ProposalRESTHandler {
return govrest.ProposalRESTHandler{
SubRoute: "unsupported-service",
Handler: func(w http.ResponseWriter, r *http.Request) {
rest.WriteErrorResponse(w, http.StatusBadRequest, "Legacy REST Routes are not supported for tax exemption address proposals")
},
}
}