From 10498b953d36304b441fcb162155c2487046206f Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 22 Apr 2024 07:26:15 +0100 Subject: feat(send): `in-reply-to` tags npubs and events in addition to being used to create a new proposal revision, in-reply-to can now be used to reference other events and npubs. for example an issues or kind 1 threads where the proposal is relevant the proposal will only be marked as a revision if the first parameter is a reference to an existing proposal root --- test_utils/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test_utils/src') diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs index ad187be..a693607 100644 --- a/test_utils/src/lib.rs +++ b/test_utils/src/lib.rs @@ -4,6 +4,7 @@ use anyhow::{bail, ensure, Context, Result}; use dialoguer::theme::{ColorfulTheme, Theme}; use directories::ProjectDirs; use nostr::{self, Kind, Tag}; +use nostr_sdk::serde_json; use once_cell::sync::Lazy; use rexpect::session::{Options, PtySession}; use strip_ansi_escapes::strip_str; @@ -178,6 +179,11 @@ pub fn generate_repo_ref_event() -> nostr::Event { .unwrap() } +/// enough to fool event_is_patch_set_root +pub fn get_pretend_proposal_root_event() -> nostr::Event { + serde_json::from_str(r#"{"id":"8cb75aa4cda10a3a0f3242dc49d36159d30b3185bf63414cf6ce17f5c14a73b1","pubkey":"f53e4bcd7a9cdef049cf6467d638a1321958acd3b71eb09823fd6fadb023d768","created_at":1714984571,"kind":1617,"tags":[["t","root"]],"content":"","sig":"6c197314b8c4c61da696dff888198333004d1ecc5d7bae2c554857f2f2b0d3ecc09369a5d8ba089c1bf89e3c6f5be40ade873fd698438ef8b303ffc6df35eb3f"}"#).unwrap() +} + /// wrapper for a cli testing tool - currently wraps rexpect and dialoguer /// /// 1. allow more accurate articulation of expected behaviour -- cgit v1.2.3