Add comprehensive integration tests for smart wallet lifecycle #32
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.
Add comprehensive integration tests for smart wallet lifecycle
Summary
This PR adds comprehensive integration tests for the smart wallet system covering the complete lifecycle from factory deployment to external contract authorization. The tests verify:
The integration tests are designed to work together as a cohesive test suite, ensuring all components interact correctly throughout the smart wallet's lifecycle.
Review & Testing Checklist for Human
Risk Level: 🟡 Medium - Core functionality covered but some limitations in test approach
env.register_at()to simulate factory deployment rather than actual WASM deployment due to constructor issues. Confirm this approach adequately tests the intended functionality.target/wasm32-unknown-unknown/release/smart_wallet.wasm). Verify this file exists and is built correctly in CI.cargo testto ensure all 37 smart-wallet tests pass and no existing functionality is broken.Diagram
%%{ init : { "theme" : "default" }}%% graph TD IntegrationTests["contracts/smart-wallet/src/tests/<br/>integration.rs"]:::major-edit ModFile["contracts/smart-wallet/src/tests/<br/>mod.rs"]:::minor-edit TestConstants["contracts/smart-wallet/src/<br/>test_constants.rs"]:::major-edit LibFile["contracts/smart-wallet/src/<br/>lib.rs"]:::minor-edit CargoToml["contracts/smart-wallet/<br/>Cargo.toml"]:::minor-edit TestUtils["contracts/smart-wallet/src/tests/<br/>test_utils.rs"]:::context FactoryContract["contracts/contract-factory/<br/>src/lib.rs"]:::context WalletContract["contracts/smart-wallet/src/<br/>wallet.rs"]:::context IntegrationTests --> TestUtils IntegrationTests --> TestConstants IntegrationTests --> FactoryContract IntegrationTests --> WalletContract ModFile --> IntegrationTests LibFile --> TestConstants CargoToml --> FactoryContract classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFF subgraph Legend L1["Major Edit"]:::major-edit L2["Minor Edit"]:::minor-edit L3["Context/No Edit"]:::context endNotes
factory_client.upload_and_deploy(), the comprehensive test usesenv.register_at()to simulate factory deployment while still testing address prediction and role setup.contract-factoryas a dev dependency to enable factory client testing in smart-wallet integration tests.Link to Devin run: https://app.devin.ai/sessions/9e36b62b578546f083a2dff857c947f6
Requested by: Alberto García (@alberto-crossmint)