Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger Auto Gen - Mint #5185

Merged
merged 4 commits into from
Oct 14, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions x/mint/client/rest/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ func registerQueryRoutes(cliCtx context.CLIContext, r *mux.Router) {
).Methods("GET")
}

type mintParams struct { // nolint: deadcode unused
Height int64 `json:"height"`
Result types.Params `json:"result"`
}

// queryParamsHandlerFn implements a query route for params of the mint module
//
// @Summary Minting module parameters
// @Tags mint
// @Produce json
// @Param height query string false "Block height to execute query (defaults to chain tip)"
// @Success 200 {object} mintParams
// @Failure 500 {object} rest.ErrorResponse "Returned on server error"
// @Router /minting/parameters [get]
func queryParamsHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryParameters)
Expand All @@ -48,6 +62,20 @@ func queryParamsHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
}
}

type mintInflation struct { // nolint: deadcode unused
Height int64 `json:"height"`
Result string `json:"result"`
}

// queryInflationHandlerFn implements a query for current minting inflation value
//
// @Summary Current minting inflation value
// @Tags mint
// @Produce json
// @Param height query string false "Block height to execute query (defaults to chain tip)"
// @Success 200 {object} mintInflation
// @Failure 500 {object} rest.ErrorResponse "Returned on server error"
// @Router /minting/inflation [get]
func queryInflationHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryInflation)
Expand All @@ -68,6 +96,20 @@ func queryInflationHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
}
}

type mintAnnualProvisions struct { // nolint: deadcode unused
Height int64 `json:"height"`
Result string `json:"result"`
}

// queryAnnualProvisionsHandlerFn implements a query for current minting annual provisions value
//
// @Summary Current minting annual provisions value
// @Tags mint
// @Produce json
// @Param height query string false "Block height to execute query (defaults to chain tip)"
// @Success 200 {object} mintAnnualProvisions
// @Failure 500 {object} rest.ErrorResponse "Returned on server error"
// @Router /minting/inflation [get]
func queryAnnualProvisionsHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryAnnualProvisions)
Expand Down