diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-07-24 16:37:10 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-07-24 16:37:10 +0100 |
| commit | 8638b321fdff94d034ec912ecd0910b6f564ff04 (patch) | |
| tree | 411e0ca989d8c53be5b11b39461297bf6a92d781 /test_utils/src | |
| parent | 95cb9c040dfa8ca18bf907a44a86df35b316b6ca (diff) | |
refactor: use nip34 kinds from rust-nostr
instead of Kind::Custom(u16) as v33 of rust-nostr introduced them
Diffstat (limited to 'test_utils/src')
| -rw-r--r-- | test_utils/src/git.rs | 4 | ||||
| -rw-r--r-- | test_utils/src/lib.rs | 7 |
2 files changed, 4 insertions, 7 deletions
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}; | |||
| 8 | use nostr::nips::nip01::Coordinate; | 8 | use nostr::nips::nip01::Coordinate; |
| 9 | use nostr_sdk::{Kind, ToBech32}; | 9 | use nostr_sdk::{Kind, ToBech32}; |
| 10 | 10 | ||
| 11 | use crate::{generate_repo_ref_event, REPOSITORY_KIND}; | 11 | use crate::generate_repo_ref_event; |
| 12 | 12 | ||
| 13 | pub struct GitTestRepo { | 13 | pub struct GitTestRepo { |
| 14 | pub dir: PathBuf, | 14 | pub dir: PathBuf, |
| @@ -19,7 +19,7 @@ impl Default for GitTestRepo { | |||
| 19 | fn default() -> Self { | 19 | fn default() -> Self { |
| 20 | let repo_event = generate_repo_ref_event(); | 20 | let repo_event = generate_repo_ref_event(); |
| 21 | let coordinate = Coordinate { | 21 | let coordinate = Coordinate { |
| 22 | kind: Kind::Custom(REPOSITORY_KIND), | 22 | kind: Kind::GitRepoAnnouncement, |
| 23 | public_key: repo_event.author(), | 23 | public_key: repo_event.author(), |
| 24 | identifier: repo_event.identifier().unwrap().to_string(), | 24 | identifier: repo_event.identifier().unwrap().to_string(), |
| 25 | relays: vec![ | 25 | 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; | |||
| 21 | pub mod git; | 21 | pub mod git; |
| 22 | pub mod relay; | 22 | pub mod relay; |
| 23 | 23 | ||
| 24 | pub static PATCH_KIND: u16 = 1617; | ||
| 25 | pub static REPOSITORY_KIND: u16 = 30617; | ||
| 26 | |||
| 27 | pub static TEST_KEY_1_NSEC: &str = | 24 | pub static TEST_KEY_1_NSEC: &str = |
| 28 | "nsec1ppsg5sm2aexq06juxmu9evtutr6jkwkhp98exxxvwamhru9lyx9s3rwseq"; | 25 | "nsec1ppsg5sm2aexq06juxmu9evtutr6jkwkhp98exxxvwamhru9lyx9s3rwseq"; |
| 29 | pub static TEST_KEY_1_SK_HEX: &str = | 26 | pub static TEST_KEY_1_SK_HEX: &str = |
| @@ -158,7 +155,7 @@ pub fn generate_repo_ref_event() -> nostr::Event { | |||
| 158 | // author and committer from global git config | 155 | // author and committer from global git config |
| 159 | let root_commit = "9ee507fc4357d7ee16a5d8901bedcd103f23c17d"; | 156 | let root_commit = "9ee507fc4357d7ee16a5d8901bedcd103f23c17d"; |
| 160 | nostr::event::EventBuilder::new( | 157 | nostr::event::EventBuilder::new( |
| 161 | nostr::Kind::Custom(REPOSITORY_KIND), | 158 | nostr::Kind::GitRepoAnnouncement, |
| 162 | "", | 159 | "", |
| 163 | [ | 160 | [ |
| 164 | Tag::identifier( | 161 | Tag::identifier( |
| @@ -1244,7 +1241,7 @@ fn get_first_proposal_event_id() -> Result<nostr::EventId> { | |||
| 1244 | let proposals = Handle::current().block_on(client.get_events_of( | 1241 | let proposals = Handle::current().block_on(client.get_events_of( |
| 1245 | vec![ | 1242 | vec![ |
| 1246 | nostr::Filter::default() | 1243 | nostr::Filter::default() |
| 1247 | .kind(nostr::Kind::Custom(PATCH_KIND)) | 1244 | .kind(nostr::Kind::GitPatch) |
| 1248 | .custom_tag( | 1245 | .custom_tag( |
| 1249 | nostr::SingleLetterTag::lowercase(nostr::Alphabet::T), | 1246 | nostr::SingleLetterTag::lowercase(nostr::Alphabet::T), |
| 1250 | vec!["root"], | 1247 | vec!["root"], |