diff options
Diffstat (limited to 'grasp-audit/src/specs/grasp01/nip01_smoke.rs')
| -rw-r--r-- | grasp-audit/src/specs/grasp01/nip01_smoke.rs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/grasp-audit/src/specs/grasp01/nip01_smoke.rs b/grasp-audit/src/specs/grasp01/nip01_smoke.rs index 4d0b8a4..5976252 100644 --- a/grasp-audit/src/specs/grasp01/nip01_smoke.rs +++ b/grasp-audit/src/specs/grasp01/nip01_smoke.rs | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | //! We don't comprehensively test NIP-01 because rust-nostr already has 1000+ tests. | 4 | //! We don't comprehensively test NIP-01 because rust-nostr already has 1000+ tests. |
| 5 | //! These are just smoke tests to ensure the relay is working at all. | 5 | //! These are just smoke tests to ensure the relay is working at all. |
| 6 | 6 | ||
| 7 | use crate::specs::grasp01::SpecRef; | ||
| 7 | use crate::{AuditClient, AuditResult, FixtureKind, TestContext, TestResult}; | 8 | use crate::{AuditClient, AuditResult, FixtureKind, TestContext, TestResult}; |
| 8 | use nostr_sdk::prelude::*; | 9 | use nostr_sdk::prelude::*; |
| 9 | 10 | ||
| @@ -32,8 +33,8 @@ impl Nip01SmokeTests { | |||
| 32 | pub async fn test_websocket_connection(client: &AuditClient) -> TestResult { | 33 | pub async fn test_websocket_connection(client: &AuditClient) -> TestResult { |
| 33 | TestResult::new( | 34 | TestResult::new( |
| 34 | "websocket_connection", | 35 | "websocket_connection", |
| 35 | "GRASP-01:nostr-relay:7", | 36 | SpecRef::NostrRelayNip01Compliant, |
| 36 | "Can establish WebSocket connection to /", | 37 | "MUST serve a relay at / via WebSocket", |
| 37 | ) | 38 | ) |
| 38 | .run(|| async { | 39 | .run(|| async { |
| 39 | if !client.is_connected().await { | 40 | if !client.is_connected().await { |
| @@ -61,8 +62,8 @@ impl Nip01SmokeTests { | |||
| 61 | pub async fn test_send_receive_event(client: &AuditClient) -> TestResult { | 62 | pub async fn test_send_receive_event(client: &AuditClient) -> TestResult { |
| 62 | TestResult::new( | 63 | TestResult::new( |
| 63 | "send_receive_event", | 64 | "send_receive_event", |
| 64 | "GRASP-01:nostr-relay:7", | 65 | SpecRef::NostrRelayNip01Compliant, |
| 65 | "Can send EVENT and receive OK response", | 66 | "MUST accept valid EVENT messages", |
| 66 | ) | 67 | ) |
| 67 | .run(|| async { | 68 | .run(|| async { |
| 68 | // Step 1: GENERATE - Create TestContext and get ValidRepo fixture | 69 | // Step 1: GENERATE - Create TestContext and get ValidRepo fixture |
| @@ -127,8 +128,8 @@ impl Nip01SmokeTests { | |||
| 127 | pub async fn test_create_subscription(client: &AuditClient) -> TestResult { | 128 | pub async fn test_create_subscription(client: &AuditClient) -> TestResult { |
| 128 | TestResult::new( | 129 | TestResult::new( |
| 129 | "create_subscription", | 130 | "create_subscription", |
| 130 | "GRASP-01:nostr-relay:7", | 131 | SpecRef::NostrRelayNip01Compliant, |
| 131 | "Can create subscription with REQ and receive EOSE", | 132 | "MUST support REQ subscriptions", |
| 132 | ) | 133 | ) |
| 133 | .run(|| async { | 134 | .run(|| async { |
| 134 | // Step 1: GENERATE - Create TestContext and get ValidRepo fixture | 135 | // Step 1: GENERATE - Create TestContext and get ValidRepo fixture |
| @@ -165,8 +166,8 @@ impl Nip01SmokeTests { | |||
| 165 | pub async fn test_close_subscription(client: &AuditClient) -> TestResult { | 166 | pub async fn test_close_subscription(client: &AuditClient) -> TestResult { |
| 166 | TestResult::new( | 167 | TestResult::new( |
| 167 | "close_subscription", | 168 | "close_subscription", |
| 168 | "GRASP-01:nostr-relay:7", | 169 | SpecRef::NostrRelayNip01Compliant, |
| 169 | "Can close subscriptions", | 170 | "MUST support CLOSE to end subscriptions", |
| 170 | ) | 171 | ) |
| 171 | .run(|| async { | 172 | .run(|| async { |
| 172 | // For now, we just verify we can query events | 173 | // For now, we just verify we can query events |
| @@ -193,8 +194,8 @@ impl Nip01SmokeTests { | |||
| 193 | pub async fn test_reject_invalid_signature(client: &AuditClient) -> TestResult { | 194 | pub async fn test_reject_invalid_signature(client: &AuditClient) -> TestResult { |
| 194 | TestResult::new( | 195 | TestResult::new( |
| 195 | "reject_invalid_signature", | 196 | "reject_invalid_signature", |
| 196 | "GRASP-01:nostr-relay:7", | 197 | SpecRef::NostrRelayNip01Compliant, |
| 197 | "Rejects events with invalid signatures", | 198 | "MUST reject events with invalid signatures", |
| 198 | ) | 199 | ) |
| 199 | .run(|| async { | 200 | .run(|| async { |
| 200 | // Create a valid event | 201 | // Create a valid event |
| @@ -247,8 +248,8 @@ impl Nip01SmokeTests { | |||
| 247 | pub async fn test_reject_invalid_event_id(client: &AuditClient) -> TestResult { | 248 | pub async fn test_reject_invalid_event_id(client: &AuditClient) -> TestResult { |
| 248 | TestResult::new( | 249 | TestResult::new( |
| 249 | "reject_invalid_event_id", | 250 | "reject_invalid_event_id", |
| 250 | "GRASP-01:nostr-relay:7", | 251 | SpecRef::NostrRelayNip01Compliant, |
| 251 | "Rejects events with invalid event IDs", | 252 | "MUST reject events where ID doesn't match hash", |
| 252 | ) | 253 | ) |
| 253 | .run(|| async { | 254 | .run(|| async { |
| 254 | // Create a valid event | 255 | // Create a valid event |