diff options
Diffstat (limited to 'tests/sync/live_sync.rs')
| -rw-r--r-- | tests/sync/live_sync.rs | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/tests/sync/live_sync.rs b/tests/sync/live_sync.rs index 3432687..9342cde 100644 --- a/tests/sync/live_sync.rs +++ b/tests/sync/live_sync.rs | |||
| @@ -24,39 +24,6 @@ use nostr_sdk::prelude::*; | |||
| 24 | 24 | ||
| 25 | use crate::common::{sync_helpers::*, TestRelay}; | 25 | use crate::common::{sync_helpers::*, TestRelay}; |
| 26 | 26 | ||
| 27 | /// Create a valid repository announcement event for testing sync. | ||
| 28 | /// | ||
| 29 | /// This creates a kind 30617 event with required clone and relays tags. | ||
| 30 | /// The event lists all provided domains so it will be accepted by each | ||
| 31 | /// relay's write policy. | ||
| 32 | /// | ||
| 33 | /// # Arguments | ||
| 34 | /// * `keys` - Keys for signing | ||
| 35 | /// * `domains` - Slice of domain strings (e.g., "127.0.0.1:8080") | ||
| 36 | /// * `identifier` - Repository identifier (d-tag) | ||
| 37 | fn create_repo_announcement(keys: &Keys, domains: &[&str], identifier: &str) -> Event { | ||
| 38 | // Build clone URLs for all domains (with .git suffix) | ||
| 39 | let clone_urls: Vec<String> = domains | ||
| 40 | .iter() | ||
| 41 | .map(|d| format!("http://{}/{}.git", d, identifier)) | ||
| 42 | .collect(); | ||
| 43 | |||
| 44 | // Build relay URLs for all domains | ||
| 45 | let relay_urls: Vec<String> = domains.iter().map(|d| format!("ws://{}", d)).collect(); | ||
| 46 | |||
| 47 | // Build tags for repository announcement | ||
| 48 | let tags = vec![ | ||
| 49 | Tag::identifier(identifier), | ||
| 50 | Tag::custom(TagKind::custom("clone"), clone_urls), | ||
| 51 | Tag::custom(TagKind::custom("relays"), relay_urls), | ||
| 52 | ]; | ||
| 53 | |||
| 54 | EventBuilder::new(Kind::Custom(KIND_REPOSITORY_STATE), "Repository state") | ||
| 55 | .tags(tags) | ||
| 56 | .sign_with_keys(keys) | ||
| 57 | .expect("Failed to sign repo announcement") | ||
| 58 | } | ||
| 59 | |||
| 60 | /// Test 5: Live sync Layer 2 events | 27 | /// Test 5: Live sync Layer 2 events |
| 61 | /// | 28 | /// |
| 62 | /// Verifies that Layer 2 events (kind 1618 issues) published to one relay | 29 | /// Verifies that Layer 2 events (kind 1618 issues) published to one relay |