From 15892018705b3b4ca42586174518319adc224c0e Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 28 Nov 2025 02:30:10 +0000 Subject: fix running audit with production flag no events were allowed to be published which broke most tests --- grasp-audit/src/bin/grasp-audit.rs | 5 ++++- grasp-audit/src/specs/grasp01/nip01_smoke.rs | 12 ++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/grasp-audit/src/bin/grasp-audit.rs b/grasp-audit/src/bin/grasp-audit.rs index b810bea..760ed55 100644 --- a/grasp-audit/src/bin/grasp-audit.rs +++ b/grasp-audit/src/bin/grasp-audit.rs @@ -48,11 +48,14 @@ async fn main() -> Result<()> { match cli.command { Commands::Audit { relay, mode, spec, git_data_dir } => { - let config = match mode.as_str() { + let mut config = match mode.as_str() { "ci" => AuditConfig::ci(), "production" => AuditConfig::production(), _ => return Err(anyhow!("Invalid mode: {}. Use 'ci' or 'production'", mode)), }; + + // Audit needs to create events to test the relay, so disable read-only mode + config.read_only = false; // Derive relay_domain from relay URL (e.g., "ws://localhost:8081" -> "localhost:8081") let relay_domain = relay diff --git a/grasp-audit/src/specs/grasp01/nip01_smoke.rs b/grasp-audit/src/specs/grasp01/nip01_smoke.rs index 182e362..b16d61a 100644 --- a/grasp-audit/src/specs/grasp01/nip01_smoke.rs +++ b/grasp-audit/src/specs/grasp01/nip01_smoke.rs @@ -32,7 +32,7 @@ impl Nip01SmokeTests { pub async fn test_websocket_connection(client: &AuditClient) -> TestResult { TestResult::new( "websocket_connection", - "NIP-01:basic", + "NIP-01", "Can establish WebSocket connection to /", ) .run(|| async { @@ -61,7 +61,7 @@ impl Nip01SmokeTests { pub async fn test_send_receive_event(client: &AuditClient) -> TestResult { TestResult::new( "send_receive_event", - "NIP-01:event-message", + "NIP-01", "Can send EVENT and receive OK response", ) .run(|| async { @@ -127,7 +127,7 @@ impl Nip01SmokeTests { pub async fn test_create_subscription(client: &AuditClient) -> TestResult { TestResult::new( "create_subscription", - "NIP-01:req-message", + "NIP-01", "Can create subscription with REQ and receive EOSE", ) .run(|| async { @@ -165,7 +165,7 @@ impl Nip01SmokeTests { pub async fn test_close_subscription(client: &AuditClient) -> TestResult { TestResult::new( "close_subscription", - "NIP-01:close-message", + "NIP-01", "Can close subscriptions", ) .run(|| async { @@ -193,7 +193,7 @@ impl Nip01SmokeTests { pub async fn test_reject_invalid_signature(client: &AuditClient) -> TestResult { TestResult::new( "reject_invalid_signature", - "NIP-01:validation", + "NIP-01", "Rejects events with invalid signatures", ) .run(|| async { @@ -247,7 +247,7 @@ impl Nip01SmokeTests { pub async fn test_reject_invalid_event_id(client: &AuditClient) -> TestResult { TestResult::new( "reject_invalid_event_id", - "NIP-01:validation", + "NIP-01", "Rejects events with invalid event IDs", ) .run(|| async { -- cgit v1.2.3