Skip to content

Guard zero-token governance vote percentages#439

Open
giwaov wants to merge 1 commit into
canopy-network:mainfrom
giwaov:issue-governance-zero-vote-percent
Open

Guard zero-token governance vote percentages#439
giwaov wants to merge 1 commit into
canopy-network:mainfrom
giwaov:issue-governance-zero-vote-percent

Conversation

@giwaov

@giwaov giwaov commented Jun 28, 2026

Copy link
Copy Markdown

Summary

  • Add a shared vote percentage helper that returns zero when total voting power is zero.
  • Use the helper for account and validator poll result percentages.
  • Add coverage for poll results when all account voting power is staked or in the DAO pool.

Why

Governance poll result rendering can encounter a voting group with zero total tokens. The previous direct division by total tokens could produce invalid percentage values for that group.

Testing

  • git diff --check
  • Not run: Go toolchain is not installed in this environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant