Skip to content

feat: emit key_revld event on successful reveal_key - #98

Merged
fejilaup-cloud merged 2 commits into
AtomicIP:mainfrom
graycioustukura-sketch:feat/reveal-key-event
Mar 26, 2026
Merged

feat: emit key_revld event on successful reveal_key#98
fejilaup-cloud merged 2 commits into
AtomicIP:mainfrom
graycioustukura-sketch:feat/reveal-key-event

Conversation

@graycioustukura-sketch

Copy link
Copy Markdown

Close #17

- Add KeyRevealedEvent contracttype with swap_id and decryption_key fields
- reveal_key drops the leading underscore and calls env.events().publish
  with topic key_revld after the state write — fires exactly once on success
- Add 4 tests:
  - test_reveal_key_emits_event_with_correct_values: asserts topic, swap_id,
    and decryption_key match exactly
  - test_reveal_key_on_pending_swap_fails_no_event: panics before event fires
  - test_reveal_key_on_completed_swap_fails_no_event: double-reveal panics
  - test_no_event_emitted_on_normal_completion_without_reveal: zero events
    when reveal_key is never called

Closes AtomicIP#18
@drips-wave

drips-wave Bot commented Mar 25, 2026

Copy link
Copy Markdown

@graycioustukura-sketch Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@fejilaup-cloud
fejilaup-cloud merged commit e2ebd57 into AtomicIP:main Mar 26, 2026
0 of 4 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.

Fix: reveal_key does not emit an event

2 participants