Skip to content

fix(content-access): add expired/wrong-buyer/wrong-content_id unlock …#802

Open
levoski1 wants to merge 1 commit intoMyFanss:mainfrom
levoski1:fix/content-access-expired-invalid-unlock-tests
Open

fix(content-access): add expired/wrong-buyer/wrong-content_id unlock …#802
levoski1 wants to merge 1 commit intoMyFanss:mainfrom
levoski1:fix/content-access-expired-invalid-unlock-tests

Conversation

@levoski1
Copy link
Copy Markdown

…tests (ISSUES.md #4)

  • Add Purchase struct with expiry ledger sequence field
  • Add PurchaseExpired (4) and NotBuyer (6) error variants
  • Update unlock_content to accept expiry_ledger param and store Purchase
  • Update has_access to check expiry against current ledger sequence
  • Add verify_access fn: panics with NotBuyer or PurchaseExpired
  • Add test_unlock_with_expired_purchase: verifies has_access=false and PurchaseExpired after ledger advance
  • Add test_unlock_with_wrong_content_id: verifies NotBuyer for unpurchased content_id
  • Add test_unlock_as_non_buyer: verifies NotBuyer for address with no purchase record
  • Add test_repurchase_after_expiry: expired purchase can be re-purchased
  • Update content_query_test.rs to use existing set/get_content_price API
  • All existing tests updated to pass expiry_ledger=u64::MAX (non-expiring)

closes #604

…tests (ISSUES.md MyFanss#4)

- Add Purchase struct with expiry ledger sequence field
- Add PurchaseExpired (4) and NotBuyer (6) error variants
- Update unlock_content to accept expiry_ledger param and store Purchase
- Update has_access to check expiry against current ledger sequence
- Add verify_access fn: panics with NotBuyer or PurchaseExpired
- Add test_unlock_with_expired_purchase: verifies has_access=false and PurchaseExpired after ledger advance
- Add test_unlock_with_wrong_content_id: verifies NotBuyer for unpurchased content_id
- Add test_unlock_as_non_buyer: verifies NotBuyer for address with no purchase record
- Add test_repurchase_after_expiry: expired purchase can be re-purchased
- Update content_query_test.rs to use existing set/get_content_price API
- All existing tests updated to pass expiry_ledger=u64::MAX (non-expiring)
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 23, 2026

@levoski1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Content-access: expired / wrong buyer tests

1 participant