Merge PR #4177: Update Staking Validators Rest Query

* Support pagination and status query params for /staking/validators

* Rename BondStatusToString to String
This commit is contained in:
Alexander Bezobchuk
2019-04-24 11:48:39 -04:00
committed by frog power 4000
parent 29755e66f6
commit 0e54369850
10 changed files with 142 additions and 37 deletions
+17 -1
View File
@@ -763,7 +763,23 @@ paths:
description: Internal Server Error
/staking/validators:
get:
summary: Get all validator candidates
summary: Get all validator candidates. By default it returns only the bonded validators.
parameters:
- in: query
name: status
type: string
description: The validator bond status. Must be either 'bonded', 'unbonded', or 'unbonding'.
x-example: bonded
- in: query
name: page
description: The gage number.
type: integer
x-example: 1
- in: query
name: limit
description: The maximum number of items per page.
type: integer
x-example: 1
tags:
- ICS21
produces:
-1
View File
@@ -162,7 +162,6 @@ func QueryTxsByTagsRequestHandlerFn(cliCtx context.CLIContext, cdc *codec.Codec)
}
tags, page, limit, err = rest.ParseHTTPArgs(r)
if err != nil {
rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
return