-
Notifications
You must be signed in to change notification settings - Fork 292
/
rest.go
36 lines (30 loc) · 1.18 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
package rest
import (
"github.com/gorilla/mux"
"github.com/cosmos/cosmos-sdk/client/context"
govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest"
)
// Defines whildcard part of the request paths
const (
RestDenom = "denom"
RestEpoch = "epoch"
)
// RegisterRoutes registers oracle-related REST handlers to a router
func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router) {
// resgisterTxRoute(cliCtx, r)
registerQueryRoute(cliCtx, r)
}
// TaxRateUpdateProposalRESTHandler returns a ProposalRESTHandler that exposes the community pool spend REST handler with a given sub-route.
func TaxRateUpdateProposalRESTHandler(cliCtx context.CLIContext) govrest.ProposalRESTHandler {
return govrest.ProposalRESTHandler{
SubRoute: "tax_rate_update",
Handler: postTaxRateUpdateProposalHandlerFn(cliCtx),
}
}
// RewardWeightUpdateProposalRESTHandler returns a ProposalRESTHandler that exposes the community pool spend REST handler with a given sub-route.
func RewardWeightUpdateProposalRESTHandler(cliCtx context.CLIContext) govrest.ProposalRESTHandler {
return govrest.ProposalRESTHandler{
SubRoute: "reward_weight_update",
Handler: postRewardWeightUpdateProposalHandlerFn(cliCtx),
}
}