From 65330e734ebc33ab09baff744fe77d2324b56043 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 13 Jun 2024 09:26:37 +0100 Subject: feat(init): add euc marker to commit reference based on nip34 update. see nip repository commit 8fe6e062254b37f77540088cccff60fa8615751 --- src/repo_ref.rs | 5 ++++- tests/init.rs | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/repo_ref.rs b/src/repo_ref.rs index 9fb1f0c..7016257 100644 --- a/src/repo_ref.rs +++ b/src/repo_ref.rs @@ -117,7 +117,10 @@ impl RepoRef { } else { self.identifier.to_string() }), - Tag::from_standardized(TagStandard::Reference(self.root_commit.to_string())), + Tag::custom( + nostr::TagKind::Custom(std::borrow::Cow::Borrowed("r")), + vec![self.root_commit.to_string(), "euc".to_string()], + ), Tag::from_standardized(TagStandard::Name(self.name.clone())), Tag::from_standardized(TagStandard::Description(self.description.clone())), Tag::custom( diff --git a/tests/init.rs b/tests/init.rs index 43d5637..40b5a45 100644 --- a/tests/init.rs +++ b/tests/init.rs @@ -300,7 +300,7 @@ mod when_repo_not_previously_claimed { #[tokio::test] #[serial] - async fn earliest_unique_commit_as_reference() -> Result<()> { + async fn earliest_unique_commit_as_reference_with_euc_marker() -> Result<()> { let (_, _, r53, r55, r56, r57) = prep_run_init().await?; for relay in [&r53, &r55, &r56, &r57] { let event: &nostr::Event = relay @@ -310,7 +310,8 @@ mod when_repo_not_previously_claimed { .unwrap(); assert!(event.tags.iter().any(|t| t.as_vec()[0].eq("r") - && t.as_vec()[1].eq("9ee507fc4357d7ee16a5d8901bedcd103f23c17d"))); + && t.as_vec()[1].eq("9ee507fc4357d7ee16a5d8901bedcd103f23c17d") + && t.as_vec()[2].eq("euc"))); } Ok(()) } -- cgit v1.2.3