diff --git a/contracts/compliance/tests/compliance_test.rs b/contracts/compliance/tests/compliance_test.rs index 35036fa..aba52b1 100644 --- a/contracts/compliance/tests/compliance_test.rs +++ b/contracts/compliance/tests/compliance_test.rs @@ -1,5 +1,5 @@ use compliance::{ComplianceContract, ComplianceContractClient, ContractError}; -use soroban_sdk::{testutils::Address as _, Address, Env}; +use soroban_sdk::{testutils::{Address as _, Events}, Address, Env, Symbol}; fn setup() -> (Env, Address, Address, ComplianceContractClient<'static>) { let env = Env::default(); @@ -246,20 +246,17 @@ fn reinitialize_is_rejected() { // Verification: address_allowed event schema // - topics[0]: symbol "address_allowed" // - data: single Address value for the allowed address -// The snapshot harness captures the full event payload (topics and data) for regression. #[test] fn emits_address_allowed_event() { let (env, admin, subject, client) = setup(); client.allow_address(&admin, &subject); assert!(client.is_allowed(&subject)); - // Events are captured by the snapshot test harness; no additional assertions needed here. - let _ = env; + assert_eq!(last_event_symbol(&env), "address_allowed"); } // Verification: address_blocked event schema // - topics[0]: symbol "address_blocked" // - data: single Address value for the blocked address -// The snapshot harness captures the full event payload (topics and data) for regression. #[test] fn emits_address_blocked_event() { let (env, admin, subject, client) = setup(); @@ -267,14 +264,12 @@ fn emits_address_blocked_event() { assert!(client.is_allowed(&subject)); client.block_address(&admin, &subject, &None); assert!(!client.is_allowed(&subject)); - // Events are captured by the snapshot test harness; no additional assertions needed here. - let _ = env; + assert_eq!(last_event_symbol(&env), "address_blocked"); } // Verification: address_cleared event schema // - topics[0]: symbol "address_cleared" // - data: single Address value for the cleared address -// The snapshot harness captures the full event payload (topics and data) for regression. #[test] fn emits_address_cleared_event() { let (env, admin, subject, client) = setup(); @@ -283,8 +278,7 @@ fn emits_address_cleared_event() { assert!(!client.is_allowed(&subject)); client.clear_address(&admin, &subject); assert!(client.is_allowed(&subject)); - // Events are captured by the snapshot test harness; no additional assertions needed here. - let _ = env; + assert_eq!(last_event_symbol(&env), "address_cleared"); } // ── #121 Allow/Block/Clear precedence matrix ─────────────────────────────────