upleb.uk

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

summaryrefslogtreecommitdiff
path: root/test_utils/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test_utils/src/lib.rs')
-rw-r--r--test_utils/src/lib.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs
index bf6c37b..ade60fc 100644
--- a/test_utils/src/lib.rs
+++ b/test_utils/src/lib.rs
@@ -4,7 +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, nips::nip65::RelayMetadata, Kind, Tag}; 6use nostr::{self, nips::nip65::RelayMetadata, Kind, Tag};
7use nostr_sdk::{serde_json, TagStandard}; 7use nostr_sdk::{serde_json, NostrSigner, TagStandard};
8use once_cell::sync::Lazy; 8use once_cell::sync::Lazy;
9use rexpect::session::{Options, PtySession}; 9use rexpect::session::{Options, PtySession};
10use strip_ansi_escapes::strip_str; 10use strip_ansi_escapes::strip_str;
@@ -29,6 +29,13 @@ pub static TEST_KEY_1_ENCRYPTED_WEAK: &str = "ncryptsec1qg835almhlrmyxqtqeva44d5
29pub static TEST_KEY_1_KEYS: Lazy<nostr::Keys> = 29pub static TEST_KEY_1_KEYS: Lazy<nostr::Keys> =
30 Lazy::new(|| nostr::Keys::from_str(TEST_KEY_1_NSEC).unwrap()); 30 Lazy::new(|| nostr::Keys::from_str(TEST_KEY_1_NSEC).unwrap());
31 31
32pub static TEST_KEY_1_SIGNER: Lazy<NostrSigner> =
33 Lazy::new(|| NostrSigner::Keys(nostr::Keys::from_str(TEST_KEY_1_NSEC).unwrap()));
34
35pub fn generate_test_key_1_signer() -> NostrSigner {
36 NostrSigner::Keys(nostr::Keys::from_str(TEST_KEY_1_NSEC).unwrap())
37}
38
32pub fn generate_test_key_1_metadata_event(name: &str) -> nostr::Event { 39pub fn generate_test_key_1_metadata_event(name: &str) -> nostr::Event {
33 nostr::event::EventBuilder::metadata(&nostr::Metadata::new().name(name)) 40 nostr::event::EventBuilder::metadata(&nostr::Metadata::new().name(name))
34 .to_event(&TEST_KEY_1_KEYS) 41 .to_event(&TEST_KEY_1_KEYS)