-
Notifications
You must be signed in to change notification settings - Fork 93
/
gov_tx_remove_code.go
57 lines (46 loc) · 1.58 KB
/
gov_tx_remove_code.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package rest
import (
"net/http"
"github.com/cosmos/cosmos-sdk/client"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/rest"
govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/public-awesome/stargaze/v10/x/globalfee/types"
)
func ProposalRemoveCodeAuthorizationHandler(cliCtx client.Context) govrest.ProposalRESTHandler {
return govrest.ProposalRESTHandler{
SubRoute: "globalfee_remove_code_authorization",
Handler: func(w http.ResponseWriter, r *http.Request) {
var req RemoveCodeAuthorizationProposalJSONReq
if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
return
}
toStdTxResponse(cliCtx, w, req)
},
}
}
type RemoveCodeAuthorizationProposalJSONReq struct {
BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
Title string `json:"title" yaml:"title"`
Description string `json:"description" yaml:"description"`
Proposer string `json:"proposer" yaml:"proposer"`
Deposit sdk.Coins `json:"deposit" yaml:"deposit"`
CodeID uint64 `json:"code_id" yaml:"code_id"`
}
func (s RemoveCodeAuthorizationProposalJSONReq) Content() govtypes.Content {
return &types.RemoveCodeAuthorizationProposal{
Title: s.Title,
Description: s.Description,
CodeID: s.CodeID,
}
}
func (s RemoveCodeAuthorizationProposalJSONReq) GetProposer() string {
return s.Proposer
}
func (s RemoveCodeAuthorizationProposalJSONReq) GetDeposit() sdk.Coins {
return s.Deposit
}
func (s RemoveCodeAuthorizationProposalJSONReq) GetBaseReq() rest.BaseReq {
return s.BaseReq
}