From a2a99d5a4137b57e4141cf2840f2f51b38035cfa Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 13 Feb 2026 12:07:37 +0000 Subject: fix: use ValidRepoServed for events that tag repo events PR events, issues, and comments need a queryable repo announcement to reference. Changed PREvent and PREventGenerated fixtures and related tests to depend on ValidRepoServed instead of ValidRepoSent. This ensures tests will fail correctly when announcement purgatory is implemented - events tagging a repo should require that repo to be served (not in purgatory). --- grasp-audit/src/specs/grasp01/nip01_smoke.rs | 14 +++++++------- grasp-audit/src/specs/grasp01/push_authorization.rs | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'grasp-audit/src/specs') diff --git a/grasp-audit/src/specs/grasp01/nip01_smoke.rs b/grasp-audit/src/specs/grasp01/nip01_smoke.rs index 8cb4166..e3206fc 100644 --- a/grasp-audit/src/specs/grasp01/nip01_smoke.rs +++ b/grasp-audit/src/specs/grasp01/nip01_smoke.rs @@ -66,12 +66,12 @@ impl Nip01SmokeTests { "MUST accept valid EVENT messages", ) .run(|| async { - // Step 1: GENERATE - Create TestContext and get ValidRepo fixture + // Step 1: GENERATE - Create TestContext and get ValidRepoServed fixture let ctx = TestContext::new(client); let event = ctx - .get_fixture(FixtureKind::ValidRepoSent) + .get_fixture(FixtureKind::ValidRepoServed) .await - .map_err(|e| format!("Failed to create ValidRepo fixture: {}", e))?; + .map_err(|e| format!("Failed to create ValidRepoServed fixture: {}", e))?; let event_id = event.id; @@ -122,7 +122,7 @@ impl Nip01SmokeTests { /// /// ## Fixture-First Pattern /// - /// 1. **Generate**: Create TestContext and get ValidRepo fixture + /// 1. **Generate**: Create TestContext and get ValidRepoServed fixture /// 2. **Send**: Fixture already sends the event to relay /// 3. **Verify**: Subscribe and verify we receive the event pub async fn test_create_subscription(client: &AuditClient) -> TestResult { @@ -132,12 +132,12 @@ impl Nip01SmokeTests { "MUST support REQ subscriptions", ) .run(|| async { - // Step 1: GENERATE - Create TestContext and get ValidRepo fixture + // Step 1: GENERATE - Create TestContext and get ValidRepoServed fixture let ctx = TestContext::new(client); let _event = ctx - .get_fixture(FixtureKind::ValidRepoSent) + .get_fixture(FixtureKind::ValidRepoServed) .await - .map_err(|e| format!("Failed to create ValidRepo fixture: {}", e))?; + .map_err(|e| format!("Failed to create ValidRepoServed fixture: {}", e))?; // Step 2: VERIFY - Subscribe to NIP-34 announcements from this author let filter = Filter::new() diff --git a/grasp-audit/src/specs/grasp01/push_authorization.rs b/grasp-audit/src/specs/grasp01/push_authorization.rs index dc78b49..768e8f9 100644 --- a/grasp-audit/src/specs/grasp01/push_authorization.rs +++ b/grasp-audit/src/specs/grasp01/push_authorization.rs @@ -208,7 +208,7 @@ async fn setup_pr_test_repo( ) -> Result<(PathBuf, String, String, String), String> { // Get fixtures let repo_event = ctx - .get_fixture(FixtureKind::ValidRepoSent) + .get_fixture(FixtureKind::ValidRepoServed) .await .map_err(|e| format!("Failed to get repo announcement: {}", e))?; @@ -1110,7 +1110,7 @@ impl PushAuthorizationTests { let pr_event_id = pr_event.id.to_hex(); // Get repo info for cloning (fresh clone for verification) - let repo = match ctx.get_fixture(FixtureKind::ValidRepoSent).await { + let repo = match ctx.get_fixture(FixtureKind::ValidRepoServed).await { Ok(r) => r, Err(e) => { return TestResult::new(test_name, SpecRef::GitAcceptRefsNostrEventId, desc) @@ -1198,7 +1198,7 @@ impl PushAuthorizationTests { let pr_event_id = pr_event.id.to_hex(); // Get repo info for cloning (fresh clone for this test) - let repo = match ctx.get_fixture(FixtureKind::ValidRepoSent).await { + let repo = match ctx.get_fixture(FixtureKind::ValidRepoServed).await { Ok(r) => r, Err(e) => { return TestResult::new(test_name, SpecRef::GitAcceptRefsNostrEventId, desc) @@ -1289,7 +1289,7 @@ impl PushAuthorizationTests { let pr_event_id = pr_event.id.to_hex(); // Get repo info for cloning (fresh clone for this test) - let repo = match ctx.get_fixture(FixtureKind::ValidRepoSent).await { + let repo = match ctx.get_fixture(FixtureKind::ValidRepoServed).await { Ok(r) => r, Err(e) => { return TestResult::new(test_name, SpecRef::GitAcceptRefsNostrEventId, desc) -- cgit v1.2.3