Skip to content

feat(contract): add AUTH_MATRIX.md compliance test suite - #810

Merged
aji70 merged 1 commit into
MyFanss:mainfrom
Inkman007:feat/auth-matrix-sync
Apr 24, 2026
Merged

feat(contract): add AUTH_MATRIX.md compliance test suite#810
aji70 merged 1 commit into
MyFanss:mainfrom
Inkman007:feat/auth-matrix-sync

Conversation

@Inkman007

Copy link
Copy Markdown
Contributor

closes #620
Adds tests/auth_matrix.rs to the subscription crate (which already hosts cross-contract integration tests) covering all five contracts listed in AUTH_MATRIX.md:

  • myfans-token: initialize, set_admin, set_metadata, read views, approve, transfer_from, clear_allowance, mint, burn, transfer
  • creator-registry: initialize, register_creator (admin + self), unregister_creator, get_creator_id
  • subscription: init, create_plan, subscribe, read views, extend_subscription, cancel, pause/unpause, set_fee_recipient, set_fee_bps
  • content-access: initialize, unlock_content, read views, set_content_price, set_max_price, set_admin
  • earnings: init, record, get_earnings, withdraw

Each method has a valid invocation test (correct signer succeeds) and an invalid invocation test (env.set_auths(&[]) strips auth so require_auth() fails).

Cargo.toml updated to add creator-registry and earnings as dev-dependencies and register the new [[test]] target.

Adds tests/auth_matrix.rs to the subscription crate (which already
hosts cross-contract integration tests) covering all five contracts
listed in AUTH_MATRIX.md:

- myfans-token: initialize, set_admin, set_metadata, read views,
  approve, transfer_from, clear_allowance, mint, burn, transfer
- creator-registry: initialize, register_creator (admin + self),
  unregister_creator, get_creator_id
- subscription: init, create_plan, subscribe, read views,
  extend_subscription, cancel, pause/unpause, set_fee_recipient,
  set_fee_bps
- content-access: initialize, unlock_content, read views,
  set_content_price, set_max_price, set_admin
- earnings: init, record, get_earnings, withdraw

Each method has a valid invocation test (correct signer succeeds)
and an invalid invocation test (env.set_auths(&[]) strips auth so
require_auth() fails).

Cargo.toml updated to add creator-registry and earnings as
dev-dependencies and register the new [[test]] target.
@drips-wave

drips-wave Bot commented Apr 24, 2026

Copy link
Copy Markdown

@Inkman007 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

@aji70
aji70 merged commit 38ef3a7 into MyFanss:main Apr 24, 2026
3 of 10 checks passed
aji70 added a commit that referenced this pull request Apr 30, 2026
feat(contract): add AUTH_MATRIX.md compliance test suite
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.

Auth matrix kept in sync with tests

2 participants