Add edge-case tests for access control, FX oracle, streams, merchant pagination, and payment links#351
Merged
Conversation
…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
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds comprehensive edge-case coverage for four major contract areas:
#337 - AccessControl edge cases
renounce_role: Account renounces own role →has_rolereturnsfalserenounce_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_roleby admin → role granted,oracle_has_rolereturnstrueoracle_grant_roleby non-admin → fails withUnauthorizedget_fx_adminafter initialization → returns admin addressget_fx_adminbefore initialization → returnsNone#336 - Stream batch operations
top_up_multiple_streams: Sender tops up multiple streams → each deposit increasestop_up_multiple_streams: Non-sender caller →StreamError::Unauthorizedcancel_multiple_streams: Partial invalid IDs → atomic transaction (all-or-nothing)batch_withdraw_to: Multiple destinations with correct token balancesbatch_withdraw_to: Zero-accrued streams → skipped without error#334 - PaymentLinkManager batch verification
verify_batch: All active links → correct status tuplesverify_batch: Mix of existing/non-existent links → proper false status for missingverify_batch: Deactivated link → returns inactive status with use_count/max_usesverify_batch: Empty input → returns empty vecAll tests pass with expected behavior and error handling.
Closes #337
Closes #335
Closes #336
Closes #334