From 401e60b98d94bc1f51dbd4b6083e92642a36efda Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 2 Feb 2024 03:11:31 +0000 Subject: feat(repo_ref)!: align maintainers tag to nip34 style nip34 specifies that repo event tags with multiple values wuch as "relays" and "web" use theformat: `["tag", "item", "item"...]` instead of: ``` ["tag", "item"], ["tag", "item"], ``` this update also adds clarity. it is not obvious that using a p tag is intended to make the pubkey a co-maintainer. BREAKING CHANGE: format of maintainers tags in repo events has changed to reflect nip34 style and ngit will not detect the old format --- tests/claim.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'tests') diff --git a/tests/claim.rs b/tests/claim.rs index 9eb4b8a..93feb54 100644 --- a/tests/claim.rs +++ b/tests/claim.rs @@ -393,7 +393,7 @@ mod when_repo_not_previously_claimed { #[test] #[serial] - fn current_user_tagged_indicating_maintainer() -> Result<()> { + fn current_user_in_maintainers() -> Result<()> { let (_, _, r53, r55, r56) = futures::executor::block_on(prep_run_claim())?; for relay in [&r53, &r55, &r56] { let event: &nostr::Event = relay @@ -401,17 +401,13 @@ mod when_repo_not_previously_claimed { .iter() .find(|e| e.kind.as_u64().eq(&REPOSITORY_KIND)) .unwrap(); - - let relay_tags = event + let maintainers_tag = event .tags .iter() - .filter(|t| t.as_vec()[0].eq("p")) - .collect::>(); - assert_eq!(relay_tags.len(), 1); - assert_eq!( - relay_tags[0].as_vec()[1], - TEST_KEY_1_KEYS.public_key().to_string() - ); + .find(|t| t.as_vec()[0].eq("maintainers")) + .unwrap() + .as_vec(); + assert_eq!(maintainers_tag[1], TEST_KEY_1_KEYS.public_key().to_string()); } Ok(()) } -- cgit v1.2.3