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

Update Staking Validators Rest Query #4177

Merged
merged 2 commits into from
Apr 24, 2019

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Apr 23, 2019

Support pagination and bond status query params in the /staking/validators REST endpoint. The default number of validators returned is the max number of bonded validators and the default status is bonded.

closes: #4099


  • Targeted PR against correct branch (see CONTRIBUTING.md)

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.

  • Wrote tests

  • Updated relevant documentation (docs/)

  • Added a relevant changelog entry: sdkch add [section] [stanza] [message]

  • rereviewed Files changed in the github PR explorer


For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@alexanderbez alexanderbez added C:x/staking WIP T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). labels Apr 23, 2019
@codecov
Copy link

codecov bot commented Apr 23, 2019

Codecov Report

Merging #4177 into develop will decrease coverage by <.01%.
The diff coverage is 51.61%.

@@             Coverage Diff             @@
##           develop    #4177      +/-   ##
===========================================
- Coverage    60.19%   60.18%   -0.01%     
===========================================
  Files          212      212              
  Lines        15167    15187      +20     
===========================================
+ Hits          9130     9141      +11     
- Misses        5412     5417       +5     
- Partials       625      629       +4

client/lcd/swagger-ui/swagger.yaml Outdated Show resolved Hide resolved
client/lcd/swagger-ui/swagger.yaml Outdated Show resolved Hide resolved
x/staking/querier/querier_test.go Outdated Show resolved Hide resolved
@alexanderbez alexanderbez mentioned this pull request Apr 24, 2019
7 tasks
Copy link
Collaborator

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK. Side note, we should probably abstract the pagination functionality into a util to reuse it on other queriers as well.

@alexanderbez alexanderbez force-pushed the 4099-update-query-vals-handler branch from 0a26f71 to 39e6290 Compare April 24, 2019 14:23
Copy link
Contributor

@rigelrozanski rigelrozanski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

Has this been tested on the CLI? There are no new cli flags in this PR (gaiacli query staking validators)

types/staking.go Outdated Show resolved Hide resolved
x/staking/querier/querier.go Show resolved Hide resolved
x/staking/querier/querier.go Show resolved Hide resolved
@alexanderbez
Copy link
Contributor Author

Thanks for the review @rigelrozanski -- I addressed all your comments. With regards to the CLI, that was left untouched because the CLI and REST never implemented the same functionality really (ie. the CLI just returns all validators always). Should we change this too?

@rigelrozanski rigelrozanski merged commit 0e54369 into develop Apr 24, 2019
@rigelrozanski rigelrozanski deleted the 4099-update-query-vals-handler branch April 24, 2019 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/staking T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow querying of /staking/validators
4 participants