-
Notifications
You must be signed in to change notification settings - Fork 88
/
gov_tx_remove_contract.go
57 lines (46 loc) · 1.66 KB
/
gov_tx_remove_contract.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/v12/x/globalfee/types"
)
func ProposalRemoveContractAuthorizationHandler(cliCtx client.Context) govrest.ProposalRESTHandler {
return govrest.ProposalRESTHandler{
SubRoute: "globalfee_remove_contract_authorization",
Handler: func(w http.ResponseWriter, r *http.Request) {
var req RemoveContractAuthorizationProposalJSONReq
if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
return
}
toStdTxResponse(cliCtx, w, req)
},
}
}
type RemoveContractAuthorizationProposalJSONReq 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"`
ContractAddress string `json:"contract_address" yaml:"contract_address"`
}
func (s RemoveContractAuthorizationProposalJSONReq) Content() govtypes.Content {
return &types.RemoveContractAuthorizationProposal{
Title: s.Title,
Description: s.Description,
ContractAddress: s.ContractAddress,
}
}
func (s RemoveContractAuthorizationProposalJSONReq) GetProposer() string {
return s.Proposer
}
func (s RemoveContractAuthorizationProposalJSONReq) GetDeposit() sdk.Coins {
return s.Deposit
}
func (s RemoveContractAuthorizationProposalJSONReq) GetBaseReq() rest.BaseReq {
return s.BaseReq
}