Unverified Commit 70e0a367 authored by Dominique's avatar Dominique Committed by GitHub
Browse files

feat: add `/pallets/staking/validators` endpoint (#1045)



* Added the `validators` endpoint
- Controller, service, response type
- Returns all validators addresses and their corresponding status (active / waiting)

* Validators Info per block
- Added the `at` query param
- Modified the Service accordingly

* yarn lint

* Changes `array` to `Set` (James Super Tip)
- 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.

* Lint & Update docs
- yarn lint
- Added validators endpoint to the docs
- Corrected other parts of the docs mentioned by the swagger as errors.

* Added in latest e2e tests the validators endpoint

* Changes from Tarik s comments

* Adjustments in the docstring

* Update src/services/pallets/PalletsStakingValidatorsService.ts

Co-authored-by: default avatarTarik Gul <[email protected]>

* yarn lint:fix

Co-authored-by: default avatarTarik Gul <[email protected]>
parent 22f8fd47
Pipeline #241788 passed with stages
in 18 minutes and 19 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment