Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Fix inactive validators not displayed error #65

Open
wants to merge 1 commit into
base: stargate
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions apis/cosmos-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,24 @@ export default class CosmosAPI {
}
async loadValidators() {
const [
validators,
{ result: bondedValidators },
{ result: unbondingValidators },
{ result: unbondedValidators },
{ result: unspecifiedValidators },
annualProvision,
supply,
pool
] = await Promise.all([
this.query(`staking/validators?status=BOND_STATUS_BONDED`),
this.query(`staking/validators?status=BOND_STATUS_UNBONDING`),
this.query(`staking/validators?status=BOND_STATUS_UNBONDED`),
this.query(`staking/validators?status=BOND_STATUS_UNSPECIFIED`),
this.getAnnualProvision().catch(() => undefined),
this.getStakingSupply(),
this.query(`cosmos/staking/v1beta1/pool`)
])
return validators.result.map(validator => reducers.validatorReducer(validator, annualProvision, supply, pool))

const allValidators = bondedValidators.concat(unbondingValidators, unbondedValidators, unspecifiedValidators)
return allValidators.map(validator => reducers.validatorReducer(validator, annualProvision, supply, pool))
}

async getInflation() {
Expand Down