-
Notifications
You must be signed in to change notification settings - Fork 150
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
feat: add /pallets/staking/validators
endpoint
#1045
Conversation
- Controller, service, response type - Returns all validators addresses and their corresponding status (active / waiting)
closes: #301 |
- Added the `at` query param - Modified the Service accordingly
- Changed the data structure used to save the validators in the active set from an `array` to a `Set` (based on James suggestion) - Changed also the used functions accordingly. - Merged in one loop the check of which validator is in the active set and the population of the returned array.
- yarn lint - Added validators endpoint to the docs - Corrected other parts of the docs mentioned by the swagger as errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great so far, just some nits, and code changes.
@TarikGul @IkerAlus If validators can change status (go from
|
@Imod7 Either you add If the question is what is more useful as input parameter, block heights or eras, I am not sure, I see reasons for both:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one nit. Great Job! lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great to me! once merge conflicts and any remaining nits are addressed its good to go!
Co-authored-by: Tarik Gul <47201679+TarikGul@users.noreply.github.com>
Relates to this Issue #1005
Description
Adds
/pallets/staking/validators
endpoint which returns a list of all validators addresses and their corresponding status which can be eitheractive
orwaiting
.Active
means that the validator is part of the active setWaiting
means that the validator did not get into the active set this eraSample Response
Sample request :
/pallets/staking/validators
Sample response :
Todos