From b63bfc9a34657c5767c507deb7c059e24dd22779 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 25 Jun 2024 09:06:47 +0100 Subject: refactor: replace keys with signer so that nip46 bunker signing can be added --- test_utils/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test_utils') 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}; use dialoguer::theme::{ColorfulTheme, Theme}; use directories::ProjectDirs; use nostr::{self, nips::nip65::RelayMetadata, Kind, Tag}; -use nostr_sdk::{serde_json, TagStandard}; +use nostr_sdk::{serde_json, NostrSigner, TagStandard}; use once_cell::sync::Lazy; use rexpect::session::{Options, PtySession}; use strip_ansi_escapes::strip_str; @@ -29,6 +29,13 @@ pub static TEST_KEY_1_ENCRYPTED_WEAK: &str = "ncryptsec1qg835almhlrmyxqtqeva44d5 pub static TEST_KEY_1_KEYS: Lazy = Lazy::new(|| nostr::Keys::from_str(TEST_KEY_1_NSEC).unwrap()); +pub static TEST_KEY_1_SIGNER: Lazy = + Lazy::new(|| NostrSigner::Keys(nostr::Keys::from_str(TEST_KEY_1_NSEC).unwrap())); + +pub fn generate_test_key_1_signer() -> NostrSigner { + NostrSigner::Keys(nostr::Keys::from_str(TEST_KEY_1_NSEC).unwrap()) +} + pub fn generate_test_key_1_metadata_event(name: &str) -> nostr::Event { nostr::event::EventBuilder::metadata(&nostr::Metadata::new().name(name)) .to_event(&TEST_KEY_1_KEYS) -- cgit v1.2.3