From 8638b321fdff94d034ec912ecd0910b6f564ff04 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 24 Jul 2024 16:37:10 +0100 Subject: refactor: use nip34 kinds from rust-nostr instead of Kind::Custom(u16) as v33 of rust-nostr introduced them --- test_utils/src/git.rs | 4 ++-- test_utils/src/lib.rs | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'test_utils/src') diff --git a/test_utils/src/git.rs b/test_utils/src/git.rs index 7aa7e84..5e8aed5 100644 --- a/test_utils/src/git.rs +++ b/test_utils/src/git.rs @@ -8,7 +8,7 @@ use git2::{Oid, RepositoryInitOptions, Signature, Time}; use nostr::nips::nip01::Coordinate; use nostr_sdk::{Kind, ToBech32}; -use crate::{generate_repo_ref_event, REPOSITORY_KIND}; +use crate::generate_repo_ref_event; pub struct GitTestRepo { pub dir: PathBuf, @@ -19,7 +19,7 @@ impl Default for GitTestRepo { fn default() -> Self { let repo_event = generate_repo_ref_event(); let coordinate = Coordinate { - kind: Kind::Custom(REPOSITORY_KIND), + kind: Kind::GitRepoAnnouncement, public_key: repo_event.author(), identifier: repo_event.identifier().unwrap().to_string(), relays: vec![ diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs index 5125d20..bccfaf5 100644 --- a/test_utils/src/lib.rs +++ b/test_utils/src/lib.rs @@ -21,9 +21,6 @@ use tokio::runtime::Handle; pub mod git; pub mod relay; -pub static PATCH_KIND: u16 = 1617; -pub static REPOSITORY_KIND: u16 = 30617; - pub static TEST_KEY_1_NSEC: &str = "nsec1ppsg5sm2aexq06juxmu9evtutr6jkwkhp98exxxvwamhru9lyx9s3rwseq"; pub static TEST_KEY_1_SK_HEX: &str = @@ -158,7 +155,7 @@ pub fn generate_repo_ref_event() -> nostr::Event { // author and committer from global git config let root_commit = "9ee507fc4357d7ee16a5d8901bedcd103f23c17d"; nostr::event::EventBuilder::new( - nostr::Kind::Custom(REPOSITORY_KIND), + nostr::Kind::GitRepoAnnouncement, "", [ Tag::identifier( @@ -1244,7 +1241,7 @@ fn get_first_proposal_event_id() -> Result { let proposals = Handle::current().block_on(client.get_events_of( vec![ nostr::Filter::default() - .kind(nostr::Kind::Custom(PATCH_KIND)) + .kind(nostr::Kind::GitPatch) .custom_tag( nostr::SingleLetterTag::lowercase(nostr::Alphabet::T), vec!["root"], -- cgit v1.2.3