-
Notifications
You must be signed in to change notification settings - Fork 29
/
rest.go
41 lines (34 loc) · 1.02 KB
/
rest.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package rest
import (
"net/http"
"github.com/cosmos/cosmos-sdk/client"
govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest"
)
func ProposalRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler {
return govrest.ProposalRESTHandler{
SubRoute: "entity_param_change",
Handler: postProposalHandlerFn(clientCtx),
}
}
func postProposalHandlerFn(clientCtx client.Context) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// var req paramscutils.ParamChangeProposalReq
// if !rest.ReadRESTReq(w, r, clientCtx.LegacyAmino, &req) {
// return
// }
// req.BaseReq = req.BaseReq.Sanitize()
// if !req.BaseReq.ValidateBasic(w) {
// return
// }
//
// content := types.NewParams("")
// msg, err := govtypes.NewMsgSubmitProposal(content, req.Deposit, req.Proposer)
// if rest.CheckBadRequestError(w, err) {
// return
// }
// if rest.CheckBadRequestError(w, msg.ValidateBasic()) {
// return
// }
// tx.WriteGeneratedTxResponse(clientCtx, w, req.BaseReq, msg)
}
}