diff options
Diffstat (limited to 'test_utils/src/lib.rs')
| -rw-r--r-- | test_utils/src/lib.rs | 31 |
1 files changed, 17 insertions, 14 deletions
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 | ||
| 1073 | pub fn get_proposal_branch_name( | 1074 | pub 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 |