From 07f2732655893977651ab17b75a2dde5ce049a8d Mon Sep 17 00:00:00 2001 From: Cmitchelle7 Date: Mon, 24 Aug 2026 22:23:48 -0700 Subject: [PATCH 1/4] test(blacklist): add is_wallet_blacklisted view tests (#725) --- creator-keys/tests/wallet_blacklist.rs | 39 ++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/creator-keys/tests/wallet_blacklist.rs b/creator-keys/tests/wallet_blacklist.rs index 4f61842a..419096b8 100644 --- a/creator-keys/tests/wallet_blacklist.rs +++ b/creator-keys/tests/wallet_blacklist.rs @@ -298,4 +298,43 @@ fn test_blacklist_does_not_affect_other_wallets() { let supply = client.buy_key(&creator, &allowed_buyer, &100, &None); assert_eq!(supply, 1); assert_eq!(client.get_key_balance(&creator, &allowed_buyer), 1); + +// --------------------------------------------------------------------------- +// is_wallet_blacklisted view returns correct status +// --------------------------------------------------------------------------- + +#[test] +fn test_is_wallet_blacklisted_returns_false_for_non_blacklisted_wallet() { + let env = test_env_with_auths(); + let (client, _) = register_creator_keys(&env); + set_protocol_admin(&env, &client); + + let wallet = Address::generate(&env); + assert!(!client.is_wallet_blacklisted(&wallet)); } + +#[test] +fn test_is_wallet_blacklisted_returns_true_after_blacklist() { + let env = test_env_with_auths(); + let (client, _) = register_creator_keys(&env); + let admin = set_protocol_admin(&env, &client); + + let wallet = Address::generate(&env); + client.blacklist_wallet(&admin, &wallet); + assert!(client.is_wallet_blacklisted(&wallet)); +} + +#[test] +fn test_is_wallet_blacklisted_returns_false_after_removal() { + let env = test_env_with_auths(); + let (client, _) = register_creator_keys(&env); + let admin = set_protocol_admin(&env, &client); + + let wallet = Address::generate(&env); + client.blacklist_wallet(&admin, &wallet); + assert!(client.is_wallet_blacklisted(&wallet)); + + client.remove_from_blacklist(&admin, &wallet); + assert!(!client.is_wallet_blacklisted(&wallet)); +} + From 8966ff362afff0d0471356815d8cf00d7bfe7909 Mon Sep 17 00:00:00 2001 From: Cmitchelle7 Date: Mon, 24 Aug 2026 22:31:30 -0700 Subject: [PATCH 2/4] fix(blacklist): close test_blacklist_does_not_affect_other_wallets before new tests (#725) --- creator-keys/tests/wallet_blacklist.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/creator-keys/tests/wallet_blacklist.rs b/creator-keys/tests/wallet_blacklist.rs index 419096b8..2fe8748f 100644 --- a/creator-keys/tests/wallet_blacklist.rs +++ b/creator-keys/tests/wallet_blacklist.rs @@ -298,6 +298,7 @@ fn test_blacklist_does_not_affect_other_wallets() { let supply = client.buy_key(&creator, &allowed_buyer, &100, &None); assert_eq!(supply, 1); assert_eq!(client.get_key_balance(&creator, &allowed_buyer), 1); +} // --------------------------------------------------------------------------- // is_wallet_blacklisted view returns correct status From 6fe5fd1ebe18a6a282e664abca471fb59d0b264b Mon Sep 17 00:00:00 2001 From: Cmitchelle7 Date: Mon, 24 Aug 2026 22:34:03 -0700 Subject: [PATCH 3/4] fix(blacklist): remove trailing newline for cargo fmt (#725) --- creator-keys/tests/wallet_blacklist.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/creator-keys/tests/wallet_blacklist.rs b/creator-keys/tests/wallet_blacklist.rs index 2fe8748f..bdb09965 100644 --- a/creator-keys/tests/wallet_blacklist.rs +++ b/creator-keys/tests/wallet_blacklist.rs @@ -337,5 +337,4 @@ fn test_is_wallet_blacklisted_returns_false_after_removal() { client.remove_from_blacklist(&admin, &wallet); assert!(!client.is_wallet_blacklisted(&wallet)); -} - +} \ No newline at end of file From b1dc238cc3236a53916b8c112ba654a83780b9fd Mon Sep 17 00:00:00 2001 From: Cmitchelle7 Date: Mon, 24 Aug 2026 22:35:34 -0700 Subject: [PATCH 4/4] fix(blacklist): ensure single trailing newline for cargo fmt (#725) --- creator-keys/tests/wallet_blacklist.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/creator-keys/tests/wallet_blacklist.rs b/creator-keys/tests/wallet_blacklist.rs index bdb09965..2a8af865 100644 --- a/creator-keys/tests/wallet_blacklist.rs +++ b/creator-keys/tests/wallet_blacklist.rs @@ -337,4 +337,4 @@ fn test_is_wallet_blacklisted_returns_false_after_removal() { client.remove_from_blacklist(&admin, &wallet); assert!(!client.is_wallet_blacklisted(&wallet)); -} \ No newline at end of file +}