Skip to content

feat(v1): emit RotationVoted event on intermediate votes (#130) - #138

Draft
s6pa1rta3n-lab wants to merge 1 commit into
drydocs:mainfrom
s6pa1rta3n-lab:fix-issue-130
Draft

feat(v1): emit RotationVoted event on intermediate votes (#130)#138
s6pa1rta3n-lab wants to merge 1 commit into
drydocs:mainfrom
s6pa1rta3n-lab:fix-issue-130

Conversation

@s6pa1rta3n-lab

Copy link
Copy Markdown

Summary

Closes #130.

This PR adds the missing intermediate RotationVoted contract event when a resolver votes on an open rotation proposal in Tholos v1 (contracts/tholos), providing real-time off-chain visibility into in-flight committee voting progression prior to execution or deadlock cancellation.

Changes Made

  1. Contract Event Definition (contracts/tholos/src/lib.rs):
    • Defined #[contractevent] pub struct RotationVoted containing:
      • old_resolver: Address
      • new_resolver: Address
      • resolver: Address
      • approve: bool
      • yes_votes: u32
      • no_votes: u32
  2. Intermediate Vote Emission (contracts/tholos/src/lib.rs):
    • In vote_rotation, emits RotationVoted on the Ok(None) still-open proposal path after persisting state to instance storage.
  3. Unit Testing (contracts/tholos/src/test.rs):
    • Added unit test test_rotation_vote_emits_event verifying vote progression across a 5-member committee (3/5 majority required):
      • Vote 1: approve = false -> returns Ok(None) and emits RotationVoted (yes = 0, no = 1).
      • Vote 2: approve = true -> returns Ok(None) and emits RotationVoted (yes = 1, no = 1).
      • Vote 3: approve = true -> returns Ok(None) and emits RotationVoted (yes = 2, no = 1).
      • Vote 4: approve = true -> returns Ok(Some(true)) and emits RotationExecuted + ResolversUpdated.
  4. Documentation Updates:
    • Updated docs/src/CONTRACT.md (vote_rotation description and Events table).
    • Updated docs/src/ROTATION_DESIGN.md (vote_rotation description).

Verification

  • cargo build -p tholos --target wasm32v1-none --release passes.
  • cargo test passes (all 70 tholos tests, all 107 tholos-v2 tests).
  • cargo fmt --all -- --check passes.
  • cargo clippy --all-targets --all-features -- -D warnings passes.

Payout Routing

  • EVM (Base/Arbitrum/Polygon/ETH): 0xF46C9F6d70C50BF81ef3588AB523a90a594a2F89
  • Stellar: GCL6OXAMLD75BMTINA6EMRUDWK5THQUSHMYNLSNBCJAPZJHNYJTUNIBC

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

1 participant