Description
Exercise a full round-trip through Paused, Cancelled, and Restored states to confirm state-machine transitions, metadata preservation, and secondary-index consistency after each hop.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
contracts/subscription_vault/src/subscription.rs
- Test lives in
contracts/subscription_vault/src/test_lifecycle_roundtrip.rs
Suggested execution
- Fork the repo and create a branch
git checkout -b tests/lifecycle-roundtrip
- Implement changes
- Drive create -> pause -> cancel -> restore
- Assert secondary index membership after each step
- Assert emitted events in order
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Restore after long dormancy, restore with expired metadata TTL, and repeat round-trip
- Include test output and security notes
Example commit message
test: lifecycle round-trip pause/cancel/restore
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
Exercise a full round-trip through Paused, Cancelled, and Restored states to confirm state-machine transitions, metadata preservation, and secondary-index consistency after each hop.
Requirements and context
contracts/subscription_vault/src/subscription.rscontracts/subscription_vault/src/test_lifecycle_roundtrip.rsSuggested execution
git checkout -b tests/lifecycle-roundtripTest and commit
cargo test --allExample commit message
test: lifecycle round-trip pause/cancel/restoreGuidelines