Indicate whether the proposal is passing is calculated wrong
StrathCole opened this issue · comments
In commit f99cf17 there was the new "passing…" (the word, not the line) indicator introduced.
This seems to always calculate "Abstain" votes in favor of "Yes" votes, which does not reflect what the chain is doing.
The code responsible for this is in src/pages/gov/ProposalVotes.tsx
Lines
const consentRatio = list.slice(0, 2).map(({ ratio }) => ratio.byVoted)
const isPassing = !isBelowQuorum && BigNumber.sum(...consentRatio).gte(0.5)
simply seem to take the first two voting entries and adds them for the passing ratio, while abstain should count either not at all (which is what the chain itself does) or towards the third entry (no) if those votes are greater than "yes" votes (to display the indicator correctly).
In addition it seems that no with veto votes are not counted for the quorum threshold on the indicator.
@StrathCole - just submitted a PR that attempts to address this discrepancy and aligns the passing/not passing indicator with chain calculations documented at https://docs.terra.money/develop/module-specifications/spec-governance/#tallying. This includes honoring the veto_threshold. Awaiting TFL review...
Thank you that looks much better.