From ae87aedae9696f4c855ac3dc47e61faec9d07c15 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 28 Oct 2024 15:41:14 +0000 Subject: 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 --- test_utils/Cargo.toml | 8 ++++---- test_utils/src/git.rs | 2 +- test_utils/src/lib.rs | 31 +++++++++++++++++-------------- 3 files changed, 22 insertions(+), 19 deletions(-) (limited to 'test_utils') 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" directories = "5.0.1" futures = "0.3.28" git2 = "0.19.0" -nostr = { git = "https://github.com/rust-nostr/nostr", rev = "4dbfa94" } -nostr-database = { git = "https://github.com/rust-nostr/nostr", rev = "4dbfa94" } -nostr-sdk = { git = "https://github.com/rust-nostr/nostr", rev = "4dbfa94" } -nostr-lmdb = { git = "https://github.com/rust-nostr/nostr", rev = "4dbfa94" } +nostr = { git = "https://github.com/rust-nostr/nostr", rev = "ede2a91" } +nostr-database = { git = "https://github.com/rust-nostr/nostr", rev = "ede2a91" } +nostr-sdk = { git = "https://github.com/rust-nostr/nostr", rev = "ede2a91" } +nostr-lmdb = { git = "https://github.com/rust-nostr/nostr", rev = "ede2a91" } once_cell = "1.18.0" rand = "0.8" 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 { let coordinate = Coordinate { kind: Kind::GitRepoAnnouncement, public_key: repo_event.pubkey, - identifier: repo_event.identifier().unwrap().to_string(), + identifier: repo_event.tags.identifier().unwrap().to_string(), relays: vec![ "ws://localhost:8055".to_string(), "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( &keys.public_key(), &unsigned.created_at, &unsigned.kind, - &unsigned.tags, + &unsigned.tags.clone().to_vec(), &unsigned.content, )); @@ -1061,13 +1061,14 @@ pub async fn get_events_from_cache( git_repo_path: &Path, filters: Vec, ) -> Result> { - get_local_cache_database(git_repo_path) + Ok(get_local_cache_database(git_repo_path) .await? .query(filters.clone()) .await .context( "cannot execute query on opened git repo nostr cache database .git/nostr-cache.lmdb", - ) + )? + .to_vec()) } pub fn get_proposal_branch_name( @@ -1360,17 +1361,19 @@ fn get_first_proposal_event_id() -> Result { let client = Client::default(); Handle::current().block_on(client.add_relay("ws://localhost:8055"))?; Handle::current().block_on(client.connect_relay("ws://localhost:8055"))?; - let proposals = Handle::current().block_on(client.get_events_of( - vec![ - nostr::Filter::default() - .kind(nostr::Kind::GitPatch) - .custom_tag( - nostr::SingleLetterTag::lowercase(nostr::Alphabet::T), - vec!["root"], - ), - ], - nostr_sdk::EventSource::relays(Some(Duration::from_millis(500))), - ))?; + let proposals = Handle::current() + .block_on(client.fetch_events( + vec![ + nostr::Filter::default() + .kind(nostr::Kind::GitPatch) + .custom_tag( + nostr::SingleLetterTag::lowercase(nostr::Alphabet::T), + vec!["root"], + ), + ], + Some(Duration::from_millis(500)), + ))? + .to_vec(); Handle::current().block_on(client.disconnect())?; let proposal_1_id = proposals -- cgit v1.2.3