Problem
The manage_hub subscription contract has no comprehensive test coverage for the full subscription lifecycle. Bugs in create, renew, expiry, and grace period logic go undetected until production.
Proposed Solution
Create contracts/cntr/tests/subscription_lifecycle_tests.rs. Write at least 12 unit tests covering: valid subscription creation, renewal before expiry, renewal during grace period, renewal after full expiry (must fail), expiry detection at exact boundary, grace period start boundary, grace period end boundary, and tier upgrade path after renewal. Import and use the modules from contracts/cntr/. All implementation must live inside contracts/cntr/.
Acceptance Criteria
Problem
The manage_hub subscription contract has no comprehensive test coverage for the full subscription lifecycle. Bugs in create, renew, expiry, and grace period logic go undetected until production.
Proposed Solution
Create
contracts/cntr/tests/subscription_lifecycle_tests.rs. Write at least 12 unit tests covering: valid subscription creation, renewal before expiry, renewal during grace period, renewal after full expiry (must fail), expiry detection at exact boundary, grace period start boundary, grace period end boundary, and tier upgrade path after renewal. Import and use the modules fromcontracts/cntr/. All implementation must live insidecontracts/cntr/.Acceptance Criteria
contracts/cntr/tests/subscription_lifecycle_tests.rstest_renewal_during_grace_period)subscription_expiry.rsandgrace_period.rspeer modulescargo test