Add route for querying signing_info for all validators (#3952)

Also remove duplicate pagination:
- move function to extract query params into types/rest
- adjust pagination values locally until available in tendermint for validators

Code cleanup:
- helper function in test
- fix pagination description in swagger.yaml
- uint instead of int when possible

Closes: #3226
Closes: #3991
This commit is contained in:
Karoly Albert Szabo
2019-03-28 18:43:33 +00:00
committed by Alessio Treglia
parent e5897d8d91
commit 5bb6090e38
10 changed files with 321 additions and 90 deletions
+4 -4
View File
@@ -45,7 +45,7 @@ func ValidatorCommand(cdc *codec.Codec) *cobra.Command {
cliCtx := context.NewCLIContext().WithCodec(cdc)
result, err := getValidators(cliCtx, height)
result, err := GetValidators(cliCtx, height)
if err != nil {
return err
}
@@ -113,7 +113,7 @@ func bech32ValidatorOutput(validator *tmtypes.Validator) (ValidatorOutput, error
}, nil
}
func getValidators(cliCtx context.CLIContext, height *int64) (ResultValidatorsOutput, error) {
func GetValidators(cliCtx context.CLIContext, height *int64) (ResultValidatorsOutput, error) {
// get the node
node, err := cliCtx.GetNode()
if err != nil {
@@ -170,7 +170,7 @@ func ValidatorSetRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
return
}
output, err := getValidators(cliCtx, &height)
output, err := GetValidators(cliCtx, &height)
if err != nil {
rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
return
@@ -188,7 +188,7 @@ func LatestValidatorSetRequestHandlerFn(cliCtx context.CLIContext) http.HandlerF
return
}
output, err := getValidators(cliCtx, &height)
output, err := GetValidators(cliCtx, &height)
if err != nil {
rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
return