diff --git a/util/ValidatorSelector.js b/util/ValidatorSelector.js index 3aac30f..d36163d 100644 --- a/util/ValidatorSelector.js +++ b/util/ValidatorSelector.js @@ -46,7 +46,12 @@ class ValidatorSelector { await this.setEraToCurrentIfZero(); const validatorDisplays = {}; // used to prevent adding in validators run by the same entity const validatorsMeetingCriteria = []; - const validators = ValidatorSelector.shuffleArray((await this.api.query.session.validators())); + // https://substrate.stackexchange.com/questions/6356/get-all-validators-on-the-network-not-just-the-active-ones + const validatorData = await this.api.query.staking.validators.entries(); + const allValidators = validatorData.map(([key]) => { + return key.args.map((k) => k.toHuman()); + }).join(",").split(",").filter((e) => { return e !== undefined }); + const validators = ValidatorSelector.shuffleArray(allValidators); for(const validator of validators) { if(validatorsMeetingCriteria.length === amount) { return validatorsMeetingCriteria; diff --git a/web-sample/bundle.js b/web-sample/bundle.js index b21d049..1cd0709 100644 --- a/web-sample/bundle.js +++ b/web-sample/bundle.js @@ -81221,12 +81221,12 @@ document.addEventListener("DOMContentLoaded", async () => { function addRecommendedPool(pools) { try { - const poolId = JSON.parse(pools.text).results[0].poolId; + const { poolId } = JSON.parse(pools.text).results[0]; document.getElementById("pools").innerHTML = `

Nomination pool of the day

click here for more info

-

Pool ${poolId}

+

Pool ${poolId}

`; } catch (e) {