Skip to content

Add edge-case tests for access control, FX oracle, streams, merchant pagination, and payment links#351

Merged
Pvsaint merged 2 commits into
MetroLogic:mainfrom
euniceotowo:add-edge-case-tests
Jun 1, 2026
Merged

Add edge-case tests for access control, FX oracle, streams, merchant pagination, and payment links#351
Pvsaint merged 2 commits into
MetroLogic:mainfrom
euniceotowo:add-edge-case-tests

Conversation

@euniceotowo
Copy link
Copy Markdown
Contributor

Adds comprehensive edge-case coverage for four major contract areas:

#337 - AccessControl edge cases

  • renounce_role: Account renounces own role → has_role returns false
  • renounce_role: Account renounces role it doesn't hold → idempotent (no error)
  • transfer_admin: Non-admin calls → AccessControlError

#335 - FXOracle role management and admin retrieval

  • oracle_grant_role by admin → role granted, oracle_has_role returns true
  • oracle_grant_role by non-admin → fails with Unauthorized
  • get_fx_admin after initialization → returns admin address
  • get_fx_admin before initialization → returns None

#336 - Stream batch operations

  • top_up_multiple_streams: Sender tops up multiple streams → each deposit increases
  • top_up_multiple_streams: Non-sender caller → StreamError::Unauthorized
  • cancel_multiple_streams: Partial invalid IDs → atomic transaction (all-or-nothing)
  • batch_withdraw_to: Multiple destinations with correct token balances
  • batch_withdraw_to: Zero-accrued streams → skipped without error

#334 - PaymentLinkManager batch verification

  • verify_batch: All active links → correct status tuples
  • verify_batch: Mix of existing/non-existent links → proper false status for missing
  • verify_batch: Deactivated link → returns inactive status with use_count/max_uses
  • verify_batch: Empty input → returns empty vec

All tests pass with expected behavior and error handling.

Closes #337
Closes #335
Closes #336
Closes #334

…agination, and payment link batch verify

Adds missing coverage for AccessControl edge cases (`renounce_role`, unauthorized `transfer_admin`), `get_all_merchants` pagination, FX oracle role management and admin retrieval, stream batch operations, and payment link `verify_batch` behavior.

Closes MetroLogic#337
Closes MetroLogic#335
Closes MetroLogic#336
Closes MetroLogic#334
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

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

@Pvsaint Pvsaint merged commit 2d07b7d into MetroLogic:main Jun 1, 2026
1 check 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

2 participants