diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-11 16:53:03 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-11 16:53:03 +0000 |
| commit | 2a9160836bb87fdea3ae891563b0169c68d1c2ab (patch) | |
| tree | 583c890687beaf7f380fc0be131bdf17485f06fa /grasp-audit/src/specs/grasp01/nip01_smoke.rs | |
| parent | 52489d3b1a7d79e164b4cc901b53fd06c05ce1b1 (diff) | |
fix: resolve all fmt and clippy warnings
Main lib (src/):
- Add #[allow(dead_code)] for build_info field (stored to prevent Prometheus unregistration)
- Add #[allow(dead_code)] for first_seen field (reserved for future rate limiting)
- Replace .or_insert_with(RelaySyncNeeds::default) with .or_default()
- Replace manual div_ceil implementations with .div_ceil(100)
Test code (tests/):
- Replace .expect(&format!(...)) with .unwrap_or_else(|_| panic!(...))
- Remove needless borrows in fetch_metrics() calls
- Add #[allow(dead_code)] and #[allow(unused_imports)] to test helpers module
grasp-audit:
- Apply cargo fmt to fix formatting
Diffstat (limited to 'grasp-audit/src/specs/grasp01/nip01_smoke.rs')
| -rw-r--r-- | grasp-audit/src/specs/grasp01/nip01_smoke.rs | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/grasp-audit/src/specs/grasp01/nip01_smoke.rs b/grasp-audit/src/specs/grasp01/nip01_smoke.rs index 8a0a4d1..4dbcd3d 100644 --- a/grasp-audit/src/specs/grasp01/nip01_smoke.rs +++ b/grasp-audit/src/specs/grasp01/nip01_smoke.rs | |||
| @@ -163,23 +163,27 @@ impl Nip01SmokeTests { | |||
| 163 | /// Spec: NIP-01 CLOSE message | 163 | /// Spec: NIP-01 CLOSE message |
| 164 | /// Requirement: Relay MUST support CLOSE to end subscriptions | 164 | /// Requirement: Relay MUST support CLOSE to end subscriptions |
| 165 | pub async fn test_close_subscription(client: &AuditClient) -> TestResult { | 165 | pub async fn test_close_subscription(client: &AuditClient) -> TestResult { |
| 166 | TestResult::new("close_subscription", "GRASP-01:nostr-relay:7", "Can close subscriptions") | 166 | TestResult::new( |
| 167 | .run(|| async { | 167 | "close_subscription", |
| 168 | // For now, we just verify we can query events | 168 | "GRASP-01:nostr-relay:7", |
| 169 | // Full subscription management with CLOSE would require | 169 | "Can close subscriptions", |
| 170 | // lower-level WebSocket access | 170 | ) |
| 171 | .run(|| async { | ||
| 172 | // For now, we just verify we can query events | ||
| 173 | // Full subscription management with CLOSE would require | ||
| 174 | // lower-level WebSocket access | ||
| 171 | 175 | ||
| 172 | let filter = Filter::new().kind(Kind::TextNote).limit(1); | 176 | let filter = Filter::new().kind(Kind::TextNote).limit(1); |
| 173 | 177 | ||
| 174 | let _events = client | 178 | let _events = client |
| 175 | .subscribe(vec![filter], Some(std::time::Duration::from_secs(2))) | 179 | .subscribe(vec![filter], Some(std::time::Duration::from_secs(2))) |
| 176 | .await | 180 | .await |
| 177 | .map_err(|e| format!("Failed to subscribe: {}", e))?; | 181 | .map_err(|e| format!("Failed to subscribe: {}", e))?; |
| 178 | 182 | ||
| 179 | // If we got here, subscription worked | 183 | // If we got here, subscription worked |
| 180 | Ok(()) | 184 | Ok(()) |
| 181 | }) | 185 | }) |
| 182 | .await | 186 | .await |
| 183 | } | 187 | } |
| 184 | 188 | ||
| 185 | /// Test 5: Rejects events with invalid signatures | 189 | /// Test 5: Rejects events with invalid signatures |