Skip to content

feat(contracts): add ballot participation snapshot and tiebreak-windo…#725

Open
Nanle-code wants to merge 1 commit into
theblockcade:mainfrom
Nanle-code:feat/issue-696-map-voting-accessors
Open

feat(contracts): add ballot participation snapshot and tiebreak-windo…#725
Nanle-code wants to merge 1 commit into
theblockcade:mainfrom
Nanle-code:feat/issue-696-map-voting-accessors

Conversation

@Nanle-code
Copy link
Copy Markdown
Contributor

…w accessor

Closes #696

  • ballot_participation_snapshot(round_id): returns eligible_voters, votes_cast, participation_bps (votes*10000/eligible, 0 when unconfigured), round_active
  • tiebreak_window(round_id): returns window_start, window_end, tiebreak_required, window_open (live, computed at read time)
  • Unknown round ids return exists=false with zeroed fields
  • 8 unit tests: success, full participation, zero eligible, missing, window open/closed/not-required

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

…w accessor

Closes theblockcade#696

- ballot_participation_snapshot(round_id): returns eligible_voters,
  votes_cast, participation_bps (votes*10000/eligible, 0 when unconfigured),
  round_active
- tiebreak_window(round_id): returns window_start, window_end,
  tiebreak_required, window_open (live, computed at read time)
- Unknown round ids return exists=false with zeroed fields
- 8 unit tests: success, full participation, zero eligible, missing,
  window open/closed/not-required
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Warning

Review limit reached

@Nanle-code, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 25 minutes and 57 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 830f874c-70ab-4d79-b21e-e3b8b43c2494

📥 Commits

Reviewing files that changed from the base of the PR and between 760aa52 and 1bf1beb.

📒 Files selected for processing (6)
  • contracts/Cargo.toml
  • contracts/map-voting/Cargo.toml
  • contracts/map-voting/src/lib.rs
  • contracts/map-voting/src/storage.rs
  • contracts/map-voting/src/test.rs
  • contracts/map-voting/src/types.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Contract map-voting: add ballot participation snapshot and tiebreak-window accessor

1 participant