Modify deploy function tests to use proper role-based auth and expand smart-account tests #12
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.
Modify deploy function tests to use proper role-based auth and expand smart-account tests
Summary
This PR modifies the deploy function tests in the crossmint-contract-factory to use proper role-based authentication instead of mocking all auths, and expands the minimal smart-account test to include comprehensive functionality testing.
Key Changes:
e.mock_all_auths()from deploy function tests and replaced with proper authentication patternstest_non_deployer_cannot_deployandtest_non_deployer_cannot_upload_and_deploy) to verify role-based access control__check_authfunction and contract registrationCurrent Status:⚠️ 3 deploy function tests are currently failing due to authentication issues with the deployed CustomAccountInterface contract's constructor. The role-based access control for deploy operations is working correctly (negative tests pass), but the actual deployment tests fail when the smart-account contract's constructor is called.
Review & Testing Checklist for Human
e.mock_all_auths()and determine the correct approach for testing CustomAccountInterface deploymenttest_non_deployer_cannot_deployandtest_non_deployer_cannot_upload_and_deployproperly test role-based access controlsmart-account/src/test.rsare meaningful and properly test the contract's functionalitycargo test --workspaceand verify the expected behavior for both positive and negative test casesDiagram
%%{ init : { "theme" : "default" }}%% graph TD CF["contracts/crossmint-contract-factory/src/test.rs"]:::major-edit SA["contracts/smart-account/src/test.rs"]:::major-edit LIB["contracts/crossmint-contract-factory/src/lib.rs"]:::context WASM["contracts/crossmint-contract-factory/src/test_constants.rs"]:::context SLIB["contracts/smart-account/src/lib.rs"]:::context CF -->|"Uses WASM from"| WASM CF -->|"Tests deploy functions in"| LIB CF -->|"Deploys contracts from"| SLIB SA -->|"Tests functions in"| SLIB subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes