Commit 352ea15
committed
feat(contract): add AUTH_MATRIX.md compliance test suite
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.1 parent 3c25ddc commit 352ea15
2 files changed
Lines changed: 858 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| 35 | + | |
| 36 | + | |
30 | 37 | | |
0 commit comments