-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programgood first issueGood for newcomersGood for newcomers
Description
Description 📝
Create a test suite to verify the end-to-end integration between the central Shade contract and the Merchant Account contract during the restriction process. This confirms that roles are correctly enforced at the entry point and state changes propagate across contracts.
Proposed Steps 📝
- Test Setup:
- Create
contracts/shade/src/tests/test_shade_restriction.rs. - Deploy the Shade contract and register a merchant to deploy their account contract.
- Create
- Implement Test Cases:
- Admin Command:
- Call
restrict_merchant_account(true)as the Shade Admin. - Verify the Merchant Account contract's
is_restricted_account()now returnstrue. - Verify Shade event emission.
- Call
- Manager Command:
- Call
restrict_merchant_account(false)as a Shade Manager. - Verify the Merchant Account contract status updates correctly.
- Call
- Unauthorized Attempt:
- Attempt to trigger restriction from a random account or the merchant themselves through the Shade contract.
- Expect Shade-level
NotAuthorizedor role check panic.
- Invalid Merchant:
- Attempt to restrict an account for an address that is not registered as a merchant.
- Verify appropriate error/panic (e.g.,
MerchantNotFound).
- Admin Command:
Acceptance Criteria ✅
- Tests confirm cross-contract state synchronization.
- Access control at the Shade level is strictly verified.
- Integration is proven to handle success and failure cases gracefully.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programgood first issueGood for newcomersGood for newcomers