diff --git a/src/libs/fetch.js b/src/libs/fetch.js index bde71c28..2165dd34 100644 --- a/src/libs/fetch.js +++ b/src/libs/fetch.js @@ -165,7 +165,7 @@ export default class ChainFetch { } async getValidatorListByHeight(height) { - return this.get(`/validatorsets/${height}`).then(data => commonProcess(data)) + return this.get(`/cosmos/base/tendermint/v1beta1/validatorsets/${height}?pagination.limit=500`).then(data => commonProcess(data)) } async getStakingValidator(address) { diff --git a/src/views/Staking.vue b/src/views/Staking.vue index 50fe786a..50bc4608 100644 --- a/src/views/Staking.vue +++ b/src/views/Staking.vue @@ -334,16 +334,16 @@ export default { } else { height = 1 } - const changes = [] + const changes = {} data.validators.forEach(x => { - changes[x.pub_key.value] = { latest: Number(x.voting_power), previous: 0 } + changes[x.pub_key.key] = { latest: Number(x.voting_power), previous: 0 } }) this.$http.getValidatorListByHeight(height).then(previous => { previous.validators.forEach(x => { - if (changes[x.pub_key.value]) { - changes[x.pub_key.value].previous = Number(x.voting_power) + if (changes[x.pub_key.key]) { + changes[x.pub_key.key].previous = Number(x.voting_power) } else { - changes[x.pub_key.value] = { latest: 0, previous: Number(x.voting_power) } + changes[x.pub_key.key] = { latest: 0, previous: Number(x.voting_power) } } }) this.$set(this, 'changes', changes)