Skip to content

test: add coverage for asset events, mark_failed event order, and non-admin pause/unpause (#595 #596 #600 #607)#629

Open
ooochoche wants to merge 3 commits intoSynapse-bridgez:developfrom
ooochoche:new
Open

test: add coverage for asset events, mark_failed event order, and non-admin pause/unpause (#595 #596 #600 #607)#629
ooochoche wants to merge 3 commits intoSynapse-bridgez:developfrom
ooochoche:new

Conversation

@ooochoche
Copy link
Copy Markdown

@ooochoche ooochoche commented Mar 30, 2026

PR Description

Closes #595
Closes #596
Closes #600
Closes #607

Summary

Adds missing contract tests for event emission and admin access control in contract_test.rs.

What changed

  • Added test_add_asset_emits_event
    • Asserts Event::AssetAdded(asset_code) is the last emitted event after add_asset.
  • Added test_remove_asset_emits_event
    • Asserts Event::AssetRemoved(asset_code) is the last emitted event after remove_asset.
  • Added test_mark_failed_emits_events
    • Asserts the last two events after mark_failed are:
      1. Event::StatusUpdated(...)
      2. Event::MovedToDlq(tx_id, error_reason)
  • Added test_non_admin_cannot_pause
    • #[should_panic(expected = "not admin")]
  • Added test_non_admin_cannot_unpause
    • #[should_panic(expected = "not admin")]

Why

  • Existing coverage validated storage/state transitions but missed explicit checks for:
    • AssetAdded payload
    • AssetRemoved payload
    • ordered mark_failed event sequence and payload
    • non-admin rejection for pause and unpause

Testing

  • Added tests only in contract_test.rs.
  • Test execution was not completed in this session.

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

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

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.

3 participants