Skip to content

Add RotationVoted event for intermediate votes (#130) - #173

Open
Iker2522 wants to merge 1 commit into
drydocs:mainfrom
Iker2522:fix/vote-rotation-intermediate-event
Open

Add RotationVoted event for intermediate votes (#130)#173
Iker2522 wants to merge 1 commit into
drydocs:mainfrom
Iker2522:fix/vote-rotation-intermediate-event

Conversation

@Iker2522

@Iker2522 Iker2522 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

vote_rotation only published events on terminal outcomes (execute or deadlock-cancel). An intermediate vote that neither passes nor deadlocks the proposal fell through silently, so an off-chain indexer watching only events couldn't see votes accumulate on an open proposal.

Added a RotationVoted event (same #[contractevent] pattern as RotationExecuted/RotationCancelled), published right before the Ok(None) return once both terminal checks are ruled out. No changes to vote-counting/majority/deadlock logic.

Test plan

  • cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test pass locally
  • CONTRACT.md updated if the public interface changed
  • scripts/testnet-smoke.sh run against testnet, if this changes contract behavior in a way that affects the deployed flow
  • What you manually verified: cargo test -p tholos — 70 passed, 0 failed, including the existing terminal-path tests (test_rotation_requires_majority_then_executes, test_deadlock_autocancels_rotation) unchanged. New test asserts the exact event via to_xdr() comparison.

Closes #130

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two doc gaps in files this PR doesn't touch, so I can't anchor them inline. docs/src/CONTRACT.md's Events table and vote_rotation prose list RotationExecuted and RotationCancelled but not the new RotationVoted, so a reader concludes intermediate votes emit nothing, the exact gap this PR fixes on-chain. docs/src/ROTATION_DESIGN.md's indexer-facing event enumeration and its vote_rotation walkthrough have the same omission, so an indexer author following that doc still misses intermediate votes. Please update both, this PR's own checklist also left CONTRACT.md unchecked.

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.

[Chore] vote_rotation's intermediate votes emit no event

2 participants