upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/test_utils
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-04-22 07:26:15 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2024-05-07 09:10:33 +0100
commit10498b953d36304b441fcb162155c2487046206f (patch)
treecea78cfbb83dbbe5ddae12ffde18df94ae7d6746 /test_utils
parentc4853f69dc25408ff70cccbe923d2cd400385fc2 (diff)
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
Diffstat (limited to 'test_utils')
-rw-r--r--test_utils/src/lib.rs6
1 files changed, 6 insertions, 0 deletions
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};
4use dialoguer::theme::{ColorfulTheme, Theme}; 4use dialoguer::theme::{ColorfulTheme, Theme};
5use directories::ProjectDirs; 5use directories::ProjectDirs;
6use nostr::{self, Kind, Tag}; 6use nostr::{self, Kind, Tag};
7use nostr_sdk::serde_json;
7use once_cell::sync::Lazy; 8use once_cell::sync::Lazy;
8use rexpect::session::{Options, PtySession}; 9use rexpect::session::{Options, PtySession};
9use strip_ansi_escapes::strip_str; 10use strip_ansi_escapes::strip_str;
@@ -178,6 +179,11 @@ pub fn generate_repo_ref_event() -> nostr::Event {
178 .unwrap() 179 .unwrap()
179} 180}
180 181
182/// enough to fool event_is_patch_set_root
183pub fn get_pretend_proposal_root_event() -> nostr::Event {
184 serde_json::from_str(r#"{"id":"8cb75aa4cda10a3a0f3242dc49d36159d30b3185bf63414cf6ce17f5c14a73b1","pubkey":"f53e4bcd7a9cdef049cf6467d638a1321958acd3b71eb09823fd6fadb023d768","created_at":1714984571,"kind":1617,"tags":[["t","root"]],"content":"","sig":"6c197314b8c4c61da696dff888198333004d1ecc5d7bae2c554857f2f2b0d3ecc09369a5d8ba089c1bf89e3c6f5be40ade873fd698438ef8b303ffc6df35eb3f"}"#).unwrap()
185}
186
181/// wrapper for a cli testing tool - currently wraps rexpect and dialoguer 187/// wrapper for a cli testing tool - currently wraps rexpect and dialoguer
182/// 188///
183/// 1. allow more accurate articulation of expected behaviour 189/// 1. allow more accurate articulation of expected behaviour