Repository navigation
test: add tests for transfer restriction behaviour - #189
Open
edochieblessing09-max wants to merge 2 commits into
Open
edochieblessing09-max wants to merge 2 commits into
edochieblessing09-max wants to merge 2 commits into
Conversation
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.
Closes #161
Summary
This PR introduces comprehensive tests for transfer restriction behaviors. Previously, restricted asset transfers may not have been fully tested across all edge cases (non-compliant actors, paused assets, unauthorized states). This PR addresses those gaps to improve protocol safety and ensure state consistency during failed transactions.
Changes Included
test_transfer_reverts_when_sender_blockedandtest_transfer_reverts_when_sender_pendingto assert that users withoutApprovedcompliance clearance cannot initiate a transfer.test_transfer_reverts_when_receiver_blockedto ensure assets cannot be transferred to addresses with restricted compliance statuses.test_transfer_reverts_when_asset_paused,test_transfer_reverts_when_asset_restricted) to verify that asset lifecycle controls correctly block asset movements.test_transfer_reverts_when_contract_pausedto cover unauthorized transfer states triggered by global emergency pauses.bal_before == bal_after) are strictly preserved when a transfer fails.test_transfer_succeedsas a control to guarantee that correctly configured, compliant actors can transfer assets properly without being overly restricted.Acceptance Criteria Met
docs/transfer-restrictions.md).Impact
These tests lock in the expected behavior of the transfer validation pipeline. By guaranteeing that all restriction paths revert flawlessly without mutating state, we heavily mitigate the risk of illegal asset movements.