upleb.uk

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

summaryrefslogtreecommitdiff
path: root/test_utils
diff options
context:
space:
mode:
Diffstat (limited to 'test_utils')
-rw-r--r--test_utils/Cargo.toml8
-rw-r--r--test_utils/src/git.rs2
-rw-r--r--test_utils/src/lib.rs31
3 files changed, 22 insertions, 19 deletions
diff --git a/test_utils/Cargo.toml b/test_utils/Cargo.toml
index 403e478..f4e0c7e 100644
--- a/test_utils/Cargo.toml
+++ b/test_utils/Cargo.toml
@@ -10,10 +10,10 @@ dialoguer = "0.10.4"
10directories = "5.0.1" 10directories = "5.0.1"
11futures = "0.3.28" 11futures = "0.3.28"
12git2 = "0.19.0" 12git2 = "0.19.0"
13nostr = { git = "https://github.com/rust-nostr/nostr", rev = "4dbfa94" } 13nostr = { git = "https://github.com/rust-nostr/nostr", rev = "ede2a91" }
14nostr-database = { git = "https://github.com/rust-nostr/nostr", rev = "4dbfa94" } 14nostr-database = { git = "https://github.com/rust-nostr/nostr", rev = "ede2a91" }
15nostr-sdk = { git = "https://github.com/rust-nostr/nostr", rev = "4dbfa94" } 15nostr-sdk = { git = "https://github.com/rust-nostr/nostr", rev = "ede2a91" }
16nostr-lmdb = { git = "https://github.com/rust-nostr/nostr", rev = "4dbfa94" } 16nostr-lmdb = { git = "https://github.com/rust-nostr/nostr", rev = "ede2a91" }
17once_cell = "1.18.0" 17once_cell = "1.18.0"
18rand = "0.8" 18rand = "0.8"
19rexpect = { git = "https://github.com/rust-cli/rexpect.git", rev = "9eb61dd" } 19rexpect = { git = "https://github.com/rust-cli/rexpect.git", rev = "9eb61dd" }
diff --git a/test_utils/src/git.rs b/test_utils/src/git.rs
index 3c19a2c..470cd83 100644
--- a/test_utils/src/git.rs
+++ b/test_utils/src/git.rs
@@ -26,7 +26,7 @@ impl Default for GitTestRepo {
26 let coordinate = Coordinate { 26 let coordinate = Coordinate {
27 kind: Kind::GitRepoAnnouncement, 27 kind: Kind::GitRepoAnnouncement,
28 public_key: repo_event.pubkey, 28 public_key: repo_event.pubkey,
29 identifier: repo_event.identifier().unwrap().to_string(), 29 identifier: repo_event.tags.identifier().unwrap().to_string(),
30 relays: vec![ 30 relays: vec![
31 "ws://localhost:8055".to_string(), 31 "ws://localhost:8055".to_string(),
32 "ws://localhost:8056".to_string(), 32 "ws://localhost:8056".to_string(),
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs
index 57b0643..96558ef 100644
--- a/test_utils/src/lib.rs
+++ b/test_utils/src/lib.rs
@@ -142,7 +142,7 @@ pub fn make_event_old_or_change_user(
142 &keys.public_key(), 142 &keys.public_key(),
143 &unsigned.created_at, 143 &unsigned.created_at,
144 &unsigned.kind, 144 &unsigned.kind,
145 &unsigned.tags, 145 &unsigned.tags.clone().to_vec(),
146 &unsigned.content, 146 &unsigned.content,
147 )); 147 ));
148 148
@@ -1061,13 +1061,14 @@ pub async fn get_events_from_cache(
1061 git_repo_path: &Path, 1061 git_repo_path: &Path,
1062 filters: Vec<nostr::Filter>, 1062 filters: Vec<nostr::Filter>,
1063) -> Result<Vec<nostr::Event>> { 1063) -> Result<Vec<nostr::Event>> {
1064 get_local_cache_database(git_repo_path) 1064 Ok(get_local_cache_database(git_repo_path)
1065 .await? 1065 .await?
1066 .query(filters.clone()) 1066 .query(filters.clone())
1067 .await 1067 .await
1068 .context( 1068 .context(
1069 "cannot execute query on opened git repo nostr cache database .git/nostr-cache.lmdb", 1069 "cannot execute query on opened git repo nostr cache database .git/nostr-cache.lmdb",
1070 ) 1070 )?
1071 .to_vec())
1071} 1072}
1072 1073
1073pub fn get_proposal_branch_name( 1074pub fn get_proposal_branch_name(
@@ -1360,17 +1361,19 @@ fn get_first_proposal_event_id() -> Result<nostr::EventId> {
1360 let client = Client::default(); 1361 let client = Client::default();
1361 Handle::current().block_on(client.add_relay("ws://localhost:8055"))?; 1362 Handle::current().block_on(client.add_relay("ws://localhost:8055"))?;
1362 Handle::current().block_on(client.connect_relay("ws://localhost:8055"))?; 1363 Handle::current().block_on(client.connect_relay("ws://localhost:8055"))?;
1363 let proposals = Handle::current().block_on(client.get_events_of( 1364 let proposals = Handle::current()
1364 vec![ 1365 .block_on(client.fetch_events(
1365 nostr::Filter::default() 1366 vec![
1366 .kind(nostr::Kind::GitPatch) 1367 nostr::Filter::default()
1367 .custom_tag( 1368 .kind(nostr::Kind::GitPatch)
1368 nostr::SingleLetterTag::lowercase(nostr::Alphabet::T), 1369 .custom_tag(
1369 vec!["root"], 1370 nostr::SingleLetterTag::lowercase(nostr::Alphabet::T),
1370 ), 1371 vec!["root"],
1371 ], 1372 ),
1372 nostr_sdk::EventSource::relays(Some(Duration::from_millis(500))), 1373 ],
1373 ))?; 1374 Some(Duration::from_millis(500)),
1375 ))?
1376 .to_vec();
1374 Handle::current().block_on(client.disconnect())?; 1377 Handle::current().block_on(client.disconnect())?;
1375 1378
1376 let proposal_1_id = proposals 1379 let proposal_1_id = proposals