Skip to content

Commit 352ea15

Browse files
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

File tree

contract/contracts/subscription/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ name = "contract_integration"
1616
path = "tests/contract_integration.rs"
1717
required-features = ["testutils"]
1818

19+
[[test]]
20+
name = "auth_matrix"
21+
path = "tests/auth_matrix.rs"
22+
required-features = ["testutils"]
23+
1924
[features]
2025
testutils = ["soroban-sdk/testutils"]
2126

@@ -27,4 +32,6 @@ myfans-lib = { path = "../myfans-lib" }
2732
soroban-sdk = { workspace = true, features = ["testutils"] }
2833
myfans_token = { package = "myfans-token", path = "../myfans-token" }
2934
content_access = { package = "content-access", path = "../content-access" }
35+
creator_registry = { package = "creator-registry", path = "../creator-registry" }
36+
earnings = { package = "earnings", path = "../earnings" }
3037
myfans_lib = { package = "myfans-lib", path = "../myfans-lib", features = ["testutils"] }

0 commit comments

Comments
 (0)