upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/grasp-audit
diff options
context:
space:
mode:
Diffstat (limited to 'grasp-audit')
-rw-r--r--grasp-audit/src/client.rs15
-rw-r--r--grasp-audit/src/fixtures.rs12
-rw-r--r--grasp-audit/src/specs/grasp01/push_authorization.rs26
3 files changed, 28 insertions, 25 deletions
diff --git a/grasp-audit/src/client.rs b/grasp-audit/src/client.rs
index 5995483..b9aaba3 100644
--- a/grasp-audit/src/client.rs
+++ b/grasp-audit/src/client.rs
@@ -200,16 +200,11 @@ impl AuditClient {
200 // Wait a bit for event to propagate 200 // Wait a bit for event to propagate
201 tokio::time::sleep(Duration::from_millis(300)).await; 201 tokio::time::sleep(Duration::from_millis(300)).await;
202 202
203 // ------------------------------------------------------ 203 if !self.is_event_on_relay(event.id).await? {
204 // TODO Magically enable purgatory by uncommenting this: 204 return Err(anyhow!(
205 // ------------------------------------------------------ 205 "event sent to relay was served instead of being put in purgatory"
206 // ------------------------------------------------------ 206 ));
207 // if !self.is_event_on_relay(event.id).await? { 207 }
208 // return Err(anyhow!(
209 // "event sent to relay was served instead of being put in purgatory"
210 // ));
211 // }
212 // ------------------------------------------------------
213 208
214 Ok(event_id) 209 Ok(event_id)
215 } 210 }
diff --git a/grasp-audit/src/fixtures.rs b/grasp-audit/src/fixtures.rs
index dca204b..30df6e3 100644
--- a/grasp-audit/src/fixtures.rs
+++ b/grasp-audit/src/fixtures.rs
@@ -1172,7 +1172,11 @@ impl<'a> TestContext<'a> {
1172 1172
1173 tokio::time::sleep(Duration::from_millis(200)).await; 1173 tokio::time::sleep(Duration::from_millis(200)).await;
1174 1174
1175 if !self.client.is_event_on_relay(maintainer_state_event.id).await? { 1175 if !self
1176 .client
1177 .is_event_on_relay(maintainer_state_event.id)
1178 .await?
1179 {
1176 return Err(anyhow::anyhow!("state event not released from purgatory")); 1180 return Err(anyhow::anyhow!("state event not released from purgatory"));
1177 } 1181 }
1178 1182
@@ -1345,7 +1349,11 @@ impl<'a> TestContext<'a> {
1345 1349
1346 tokio::time::sleep(Duration::from_millis(200)).await; 1350 tokio::time::sleep(Duration::from_millis(200)).await;
1347 1351
1348 if !self.client.is_event_on_relay(recursive_maintainer_state_event.id).await? { 1352 if !self
1353 .client
1354 .is_event_on_relay(recursive_maintainer_state_event.id)
1355 .await?
1356 {
1349 return Err(anyhow::anyhow!("state event not released from purgatory")); 1357 return Err(anyhow::anyhow!("state event not released from purgatory"));
1350 } 1358 }
1351 1359
diff --git a/grasp-audit/src/specs/grasp01/push_authorization.rs b/grasp-audit/src/specs/grasp01/push_authorization.rs
index e076bee..ed69d6d 100644
--- a/grasp-audit/src/specs/grasp01/push_authorization.rs
+++ b/grasp-audit/src/specs/grasp01/push_authorization.rs
@@ -1355,19 +1355,19 @@ impl PushAuthorizationTests {
1355 } 1355 }
1356 1356
1357 // TODO - uncomment this when purgatory feature added 1357 // TODO - uncomment this when purgatory feature added
1358 // // Check event is not yet served by relay (still in purgatory) 1358 // Check event is not yet served by relay (still in purgatory)
1359 // match client.is_event_on_relay(pr_event.id).await { 1359 match client.is_event_on_relay(pr_event.id).await {
1360 // Ok(on_relay) => { 1360 Ok(on_relay) => {
1361 // if !on_relay { 1361 if !on_relay {
1362 // return TestResult::new(test_name, "GRASP-01:git-http:40", desc) 1362 return TestResult::new(test_name, "GRASP-01:git-http:40", desc)
1363 // .fail("PR event not in purgatory before correct commit pushed to refs/nostr/<event-id> (the relay serve the PR event)"); 1363 .fail("PR event not in purgatory before correct commit pushed to refs/nostr/<event-id> (the relay serve the PR event)");
1364 // } 1364 }
1365 // } 1365 }
1366 // Err(_) => { 1366 Err(_) => {
1367 // return TestResult::new(test_name, "GRASP-01:git-http:40", desc) 1367 return TestResult::new(test_name, "GRASP-01:git-http:40", desc)
1368 // .fail("failed to query relay"); 1368 .fail("failed to query relay");
1369 // } 1369 }
1370 // } 1370 }
1371 1371
1372 // Push correct commit (should succeed) 1372 // Push correct commit (should succeed)
1373 let push_succeeded = match push_to_pr_ref(&clone_path, &pr_event_id) { 1373 let push_succeeded = match push_to_pr_ref(&clone_path, &pr_event_id) {