diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-10-28 15:41:14 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-10-28 15:41:14 +0000 |
| commit | ae87aedae9696f4c855ac3dc47e61faec9d07c15 (patch) | |
| tree | 0309be588a4e3d3a510e7510300629cb2ec3a68a /test_utils | |
| parent | 5979e13cdc65ea78894dbcab3acde11b246889a7 (diff) | |
chore: bump rust-nostr to patch near v0.36.0
bump all rust-nostr packages
refactoring code based on breaking changes
upgrading to patched version to address signer issue:
nostr:nevent1qvzqqqqqqypzq6xcz9jerqgqkldy8lpg7lglcyj4g3nwzy2cs6u70wejdaj7csnjqy88wumn8ghj7mn0wvhxcmmv9uqzpsw5ph8le2n2kh6uchftawt74hddazk9tp7wjmz967y2l0uva5rc7hsstq
Diffstat (limited to 'test_utils')
| -rw-r--r-- | test_utils/Cargo.toml | 8 | ||||
| -rw-r--r-- | test_utils/src/git.rs | 2 | ||||
| -rw-r--r-- | test_utils/src/lib.rs | 31 |
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" | |||
| 10 | directories = "5.0.1" | 10 | directories = "5.0.1" |
| 11 | futures = "0.3.28" | 11 | futures = "0.3.28" |
| 12 | git2 = "0.19.0" | 12 | git2 = "0.19.0" |
| 13 | nostr = { git = "https://github.com/rust-nostr/nostr", rev = "4dbfa94" } | 13 | nostr = { git = "https://github.com/rust-nostr/nostr", rev = "ede2a91" } |
| 14 | nostr-database = { git = "https://github.com/rust-nostr/nostr", rev = "4dbfa94" } | 14 | nostr-database = { git = "https://github.com/rust-nostr/nostr", rev = "ede2a91" } |
| 15 | nostr-sdk = { git = "https://github.com/rust-nostr/nostr", rev = "4dbfa94" } | 15 | nostr-sdk = { git = "https://github.com/rust-nostr/nostr", rev = "ede2a91" } |
| 16 | nostr-lmdb = { git = "https://github.com/rust-nostr/nostr", rev = "4dbfa94" } | 16 | nostr-lmdb = { git = "https://github.com/rust-nostr/nostr", rev = "ede2a91" } |
| 17 | once_cell = "1.18.0" | 17 | once_cell = "1.18.0" |
| 18 | rand = "0.8" | 18 | rand = "0.8" |
| 19 | rexpect = { git = "https://github.com/rust-cli/rexpect.git", rev = "9eb61dd" } | 19 | rexpect = { 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 | ||
| 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 |