Skip to content

fix(v2): emit Revealed events for fixed voters in auto-reveal path - #202

Merged
collinsezedike merged 1 commit into
drydocs:mainfrom
ZacLou:fix/revealed-events-auto-reveal-156
Sep 6, 2026
Merged

fix(v2): emit Revealed events for fixed voters in auto-reveal path#202
collinsezedike merged 1 commit into
drydocs:mainfrom
ZacLou:fix/revealed-events-auto-reveal-156

Conversation

@ZacLou

@ZacLou ZacLou commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Closes #156.

open_reveal_phase automatically reveals and tallies the asserter's and disputer's fixed positions when transitioning Registration→Reveal, but was silently not emitting the corresponding Revealed events. This caused off-chain indexers and event monitors to miss the two fixed-position reveals.

What changed

  • Added Revealed { id, voter, choice }.publish(env) for both fixed voters inside the existing for loop in open_reveal_phase, directly after set_position
  • The Revealed struct already exists on the contract and is emitted by the regular reveal() entrypoint for third-party voters; this change makes the auto-reveal path consistent.

Validation

  • All 118 existing tests pass
  • test_reveal_opens_phase_counts_fixed_positions_and_verifies_commitment continues to pass (validates position.revealed=true and agree/disagree weight)
  • One minor change: 7 lines added in lib.rs, 14 lines of doc in test.rs

Closes drydocs#156.

open_reveal_phase automatically reveals and tallies the asserter's and
disputer's fixed positions when transitioning Registration→Reveal,
but was silently not emitting the corresponding Revealed events.
This caused off-chain indexers and event monitors to miss the two
fixed-position reveals.

Add Revealed { id, voter, choice }.publish(env) for both fixed voters
inside the existing for loop in open_reveal_phase, directly after
set_position (which already marks revealed=true and computes the
tally).  The Revealed struct already exists on the contract and is
emitted by the regular reveal() entrypoint for third-party voters;
this change makes the auto-reveal path consistent.

All 118 existing tests pass, including the relevant test:
test_reveal_opens_phase_counts_fixed_positions_and_verifies_commitment
(which validates position.revealed=true and agree/disagree_weight).
Snapshot files regenerated accordingly.
@ZacLou
ZacLou force-pushed the fix/revealed-events-auto-reveal-156 branch from 9373554 to 85055b7 Compare September 6, 2026 13:17
@ZacLou ZacLou changed the title fix(v2): emit Revealed events for fixed voters fix(v2): emit Revealed events for fixed voters in auto-reveal path Sep 6, 2026

@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.

Thanks for this, clean fix, matches the issue exactly. Merging now.

@collinsezedike
collinsezedike merged commit a90558d into drydocs:main Sep 6, 2026
3 checks passed
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] Missing Revealed event on tholos-v2's auto-reveal path

2 participants