From ccdbc337ae16d7c70be44166269c8b2d5b9f5c09 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 2 Feb 2024 06:44:28 +0000 Subject: feat(prs-create)!: use nip34 patch kind and tags - change kind number - remove "r-" prefix from unique commit id r tag - rename tag commit-sig to commit-pgp-sig - a tag for repo identifer and pubkey. this serves as a vote for this pubkey being a maintainer - add relay hints - change format of committer tag - remove r references to parent commit id - tag parent patch event if its part of change request author and commit-message tags still need to be removed but they are required to apply patches with gitlib2. we will need to fallback to running the git client to apply patches. BREAKING CHANGE: change patch/commit event kind and tags to reflect nip34 draft. events with the older kind will no longer be found and will not be in a valid format --- tests/prs_create.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'tests/prs_create.rs') diff --git a/tests/prs_create.rs b/tests/prs_create.rs index f473683..ca92ac2 100644 --- a/tests/prs_create.rs +++ b/tests/prs_create.rs @@ -538,16 +538,10 @@ mod sends_pr_and_2_patches_to_3_relays { #[test] #[serial] - fn parent_commit_and_parent_commit_r() -> Result<()> { + fn parent_commit() -> Result<()> { // commit parent 'r' and 'parent-commit' tag static COMMIT_PARENT_ID: &str = "232efb37ebc67692c9e9ff58b83c0d3d63971a0a"; let most_recent_patch = prep()?; - assert!( - most_recent_patch - .tags - .iter() - .any(|t| t.as_vec()[0].eq("r") && t.as_vec()[1].eq(COMMIT_PARENT_ID)) - ); assert!( most_recent_patch.tags.iter().any( |t| t.as_vec()[0].eq("parent-commit") && t.as_vec()[1].eq(COMMIT_PARENT_ID) @@ -558,9 +552,9 @@ mod sends_pr_and_2_patches_to_3_relays { #[test] #[serial] - fn root_commit_as_r_with_r_hypen_prefix() -> Result<()> { + fn root_commit_as_r() -> Result<()> { assert!(prep()?.tags.iter().any(|t| t.as_vec()[0].eq("r") - && t.as_vec()[1].eq("r-9ee507fc4357d7ee16a5d8901bedcd103f23c17d"))); + && t.as_vec()[1].eq("9ee507fc4357d7ee16a5d8901bedcd103f23c17d"))); Ok(()) } @@ -589,7 +583,7 @@ mod sends_pr_and_2_patches_to_3_relays { .find(|t| t.as_vec()[0].eq("author")) .unwrap() .as_vec(), - vec!["author", "Joe Bloggs", "joe.bloggs@pm.me", "0,0"], + vec!["author", "Joe Bloggs", "joe.bloggs@pm.me", "0", "0"], ); Ok(()) } @@ -604,7 +598,7 @@ mod sends_pr_and_2_patches_to_3_relays { .find(|t| t.as_vec()[0].eq("committer")) .unwrap() .as_vec(), - vec!["committer", "Joe Bloggs", "joe.bloggs@pm.me", "0,0"], + vec!["committer", "Joe Bloggs", "joe.bloggs@pm.me", "0", "0"], ); Ok(()) } -- cgit v1.2.3