inclusive validator of voting power

This commit is contained in:
liangping 2022-12-02 08:06:58 +08:00
parent d50d9edf06
commit f0183c6092

View File

@ -468,11 +468,10 @@ export default {
if (this.selectedStatus === 'inactive') return 'primary' if (this.selectedStatus === 'inactive') return 'primary'
const { index, item } = data const { index, item } = data
if (index === 0) { if (index === 0) {
window.sum = item.tokens window.sum = 0
} else {
window.sum += item.tokens
} }
const rank = window.sum / this.stakingPool const rank = window.sum / this.stakingPool
window.sum += item.tokens // sum up after the calculating.
if (rank < 0.333) { if (rank < 0.333) {
return 'danger' return 'danger'
} }