Skip to content

test: add event emission, concurrent escrow, and dispute lifecycle tests#459

Merged
Ibinola merged 2 commits into
Lead-Studios:mainfrom
feyishola:feat/emission-tests
Jun 29, 2026
Merged

test: add event emission, concurrent escrow, and dispute lifecycle tests#459
Ibinola merged 2 commits into
Lead-Studios:mainfrom
feyishola:feat/emission-tests

Conversation

@feyishola

Copy link
Copy Markdown
Contributor

closes #441
closes #442
closes #443
closes #444

full summary of everything implemented across the session:

What was implemented

  1. escrow_test.rs — bug fix + 6 new tests

Fixed all pre-existing compile errors: release_escrow was being called with 4 arguments (a never-implemented partial-release feature). All 4-arg calls were reduced to 3-arg, and the partial-release tests were marked #[ignore].
Added Symbol, TryFromVal to imports.
Event content tests (verify exact topic symbols, address values, and data):
test_create_escrow_event_topics_and_data
test_release_escrow_event_topics_and_data
test_refund_escrow_event_topics_and_data
Concurrent isolation tests (multiple escrows don't interfere):
test_two_escrows_independent_release
test_dispute_on_one_escrow_does_not_affect_another
test_100_escrows_all_release
test_escrow_counter_is_sequential
2. test.rs — 6 new tests

Updated import to include Symbol, TryFromVal.
Event content tests for all core token operations:
test_initialize_event_topics_and_data
test_mint_event_topics_and_data
test_burn_event_topics_and_data (scalar data path)
test_transfer_event_topics_and_data
test_approve_event_topics_and_data
test_clawback_event_topics_and_data
3. dispute_test.rs — 9 new tests

Updated import to include Symbol, TryFromVal.
Event content tests:
test_open_dispute_event_topics_and_data
test_resolve_dispute_event_topics_and_data (depositor path)
test_resolve_dispute_emits_event_with_correct_outcome (beneficiary path)
Lifecycle / terminal state tests:
test_resolve_for_beneficiary_releases_funds_to_beneficiary
test_resolve_for_depositor_refunds_funds_to_depositor
test_release_escrow_after_dispute_resolved_for_beneficiary_panics
test_refund_escrow_after_dispute_resolved_for_depositor_panics
test_open_second_dispute_on_same_escrow_while_first_is_open_panics
test_dispute_counter_increments_sequentially
4. splitter_test.rs — 1 new test

Updated import to include Symbol, TryFromVal.
test_distribute_event_topics_and_data (with documented note that create_split intentionally emits no event)
5. recurring_test.rs — 3 new tests

Updated import to include Symbol, TryFromVal.
test_setup_recurring_event_topics_and_data (tuple data: (payee, amount))
test_execute_recurring_event_topics_and_data
test_cancel_recurring_event_topics_and_data (void data: event.2.is_void())

Every state-changing function now has a test that asserts exact event topic
symbols, topic addresses/IDs, and data values — giving off-chain indexers a
contract-level regression suite for the events they depend on.

- test.rs: event content tests for initialize, mint, burn, transfer, approve,
  clawback (scalar and tuple data paths covered)
- escrow_test.rs: fix pre-existing compile errors from unimplemented partial-
  release feature; add event content tests for create/release/refund escrow;
  add concurrent isolation tests (two independent escrows, dispute on one
  doesn't affect the other, 100-escrow batch release, sequential ID counter)
- dispute_test.rs: event content tests for open_dispute and both resolve
  outcomes (true/false); lifecycle tests for terminal state enforcement
  (release/refund after resolution must panic); sequential dispute ID counter
- splitter_test.rs: event content test for distribute; document create_split
  intentional no-event
- recurring_test.rs: event content tests for setup (tuple data), execute
  (scalar data), and cancel (void data) recurring payments

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

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

@Ibinola Ibinola merged commit 82811a5 into Lead-Studios:main Jun 29, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment