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: Tarik Gul <[email protected]> * yarn lint:fix Co-authored-by: Tarik Gul <[email protected]>
Please register or sign in to comment