Skip to content

Display decoded event and contract's full path in assert_emitted/assert_not_emitted - #4568

Merged
integraledelebesgue merged 1 commit into
masterfrom
fix/display-event-name-in-assert-emitted
Sep 4, 2026
Merged

Display decoded event and contract's full path in assert_emitted/assert_not_emitted#4568
integraledelebesgue merged 1 commit into
masterfrom
fix/display-event-name-in-assert-emitted

Conversation

@integraledelebesgue

@integraledelebesgue integraledelebesgue commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Closes #2989

Introduced changes

  • New cheatcode format_event, wrapped by format_event in snforge_std, allows reverse-transformation of the event at runtime
  • Now, the error message from assert_emitted has a form:
Event <event> was not emitted from <contract-full-path> at <contract-address>
  • assert_not_emitted has analogical behaviour

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added relevant tests
  • Performed self-review of the code
  • Added changes to CHANGELOG.md

@integraledelebesgue
integraledelebesgue force-pushed the fix/display-event-name-in-assert-emitted branch from 0d668e0 to 0beb82c Compare August 25, 2026 12:40
@integraledelebesgue
integraledelebesgue marked this pull request as ready for review August 25, 2026 12:40
@integraledelebesgue
integraledelebesgue requested a review from a team as a code owner August 25, 2026 12:40
@integraledelebesgue
integraledelebesgue requested review from MKowalski8, ddoktorski and franciszekjob and removed request for MKowalski8 August 25, 2026 12:40
Comment thread crates/forge/tests/integration/spy_events.rs
Comment thread crates/forge/tests/integration/spy_events.rs
@integraledelebesgue
integraledelebesgue force-pushed the fix/display-event-name-in-assert-emitted branch 3 times, most recently from d812b19 to a1507fa Compare September 1, 2026 13:38
@integraledelebesgue
integraledelebesgue force-pushed the fix/display-event-name-in-assert-emitted branch 4 times, most recently from fbb4dc0 to 8b6605e Compare September 2, 2026 10:38
@integraledelebesgue
integraledelebesgue force-pushed the fix/display-event-name-in-assert-emitted branch from 8b6605e to 3ff3c35 Compare September 2, 2026 10:49
Comment thread snforge_std/src/cheatcodes/events.cairo
Comment thread crates/cheatnet/src/runtime_extensions/forge_runtime_extension/mod.rs Outdated
Comment thread crates/forge/tests/integration/spy_events.rs Outdated
@integraledelebesgue
integraledelebesgue force-pushed the fix/display-event-name-in-assert-emitted branch from 3ff3c35 to e01ab3e Compare September 4, 2026 12:52
@integraledelebesgue
integraledelebesgue enabled auto-merge (squash) September 4, 2026 12:53
@integraledelebesgue
integraledelebesgue merged commit 464ba04 into master Sep 4, 2026
27 checks passed
@integraledelebesgue
integraledelebesgue deleted the fix/display-event-name-in-assert-emitted branch September 4, 2026 13:10
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.

Report Event name when assert_emmited! fails

3 participants