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-03-28 12:35:37 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-03-28 12:35:37 +0000
commit4b06b2bd70d37656d727c8fffc0656c1aa3c7b97 (patch)
tree1d885fdef21a7530c1a91f848788a665d6fc9948 /test_utils
parent91a68de459b7d22a8dfb8a324e43740fca3e0a35 (diff)
parent11dc9fa2d8b82594d3803f12d2c5a49e57026cfb (diff)
Merge upgrade rust-nostr v0.29
refactor to address breaking changes in rust-nostr fix a number of in dependancy which have been upstreamed
Diffstat (limited to 'test_utils')
-rw-r--r--test_utils/Cargo.toml4
-rw-r--r--test_utils/src/lib.rs8
2 files changed, 6 insertions, 6 deletions
diff --git a/test_utils/Cargo.toml b/test_utils/Cargo.toml
index 8928f67..c4e1b1a 100644
--- a/test_utils/Cargo.toml
+++ b/test_utils/Cargo.toml
@@ -9,8 +9,8 @@ assert_cmd = "2.0.12"
9dialoguer = "0.10.4" 9dialoguer = "0.10.4"
10directories = "5.0.1" 10directories = "5.0.1"
11git2 = "0.18.1" 11git2 = "0.18.1"
12nostr = "0.27.0" 12nostr = "0.29"
13nostr-sdk = { version = "0.27.0", features = ["blocking"] } 13nostr-sdk = "0.29"
14once_cell = "1.18.0" 14once_cell = "1.18.0"
15rand = "0.8" 15rand = "0.8"
16rexpect = { git = "https://github.com/rust-cli/rexpect.git", rev = "9eb61dd" } 16rexpect = { git = "https://github.com/rust-cli/rexpect.git", rev = "9eb61dd" }
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs
index a0c67df..ad187be 100644
--- a/test_utils/src/lib.rs
+++ b/test_utils/src/lib.rs
@@ -1,9 +1,9 @@
1use std::{ffi::OsStr, path::PathBuf}; 1use std::{ffi::OsStr, path::PathBuf, str::FromStr};
2 2
3use anyhow::{bail, ensure, Context, Result}; 3use anyhow::{bail, ensure, Context, Result};
4use dialoguer::theme::{ColorfulTheme, Theme}; 4use dialoguer::theme::{ColorfulTheme, Theme};
5use directories::ProjectDirs; 5use directories::ProjectDirs;
6use nostr::{self, prelude::FromSkStr, Kind, Tag}; 6use nostr::{self, Kind, Tag};
7use once_cell::sync::Lazy; 7use once_cell::sync::Lazy;
8use rexpect::session::{Options, PtySession}; 8use rexpect::session::{Options, PtySession};
9use strip_ansi_escapes::strip_str; 9use strip_ansi_escapes::strip_str;
@@ -26,7 +26,7 @@ pub static TEST_KEY_1_DISPLAY_NAME: &str = "bob";
26pub static TEST_KEY_1_ENCRYPTED: &str = "ncryptsec1qyq607h3cykxc3f2a44u89cdk336fptccn3fm5pf3nmf93d3c86qpunc7r6klwcn6lyszjy72wxwqq9aljg4pm6atvjrds9e248yhv76xfnt464265kgnjsvg8rlg06wg4sp9uljzfpu8zuaztcvfn2j8ggdrg8mldh850cy75efsyqqansert9wqmn4e6khpgvfz7h5le9"; 26pub static TEST_KEY_1_ENCRYPTED: &str = "ncryptsec1qyq607h3cykxc3f2a44u89cdk336fptccn3fm5pf3nmf93d3c86qpunc7r6klwcn6lyszjy72wxwqq9aljg4pm6atvjrds9e248yhv76xfnt464265kgnjsvg8rlg06wg4sp9uljzfpu8zuaztcvfn2j8ggdrg8mldh850cy75efsyqqansert9wqmn4e6khpgvfz7h5le9";
27pub static TEST_KEY_1_ENCRYPTED_WEAK: &str = "ncryptsec1qy8ke0tjqnn8wt3w6lnc86c27ry3qrptxctjfcgruryxy0at238kwyjwsswd7z88thysruzw3awlrsxjvw5uptcd7vt70ft9rtkx00m8cgy3khm4hxa5d2gfnc6athnfruy2eyl6pkas8k34jg85z7xjqqadzfzh9rp0fzxqtw0tvxksac3n8yc98uksvuf93e0lcvqy8j6"; 27pub static TEST_KEY_1_ENCRYPTED_WEAK: &str = "ncryptsec1qy8ke0tjqnn8wt3w6lnc86c27ry3qrptxctjfcgruryxy0at238kwyjwsswd7z88thysruzw3awlrsxjvw5uptcd7vt70ft9rtkx00m8cgy3khm4hxa5d2gfnc6athnfruy2eyl6pkas8k34jg85z7xjqqadzfzh9rp0fzxqtw0tvxksac3n8yc98uksvuf93e0lcvqy8j6";
28pub static TEST_KEY_1_KEYS: Lazy<nostr::Keys> = 28pub static TEST_KEY_1_KEYS: Lazy<nostr::Keys> =
29 Lazy::new(|| nostr::Keys::from_sk_str(TEST_KEY_1_NSEC).unwrap()); 29 Lazy::new(|| nostr::Keys::from_str(TEST_KEY_1_NSEC).unwrap());
30 30
31pub fn generate_test_key_1_metadata_event(name: &str) -> nostr::Event { 31pub fn generate_test_key_1_metadata_event(name: &str) -> nostr::Event {
32 nostr::event::EventBuilder::metadata(&nostr::Metadata::new().name(name)) 32 nostr::event::EventBuilder::metadata(&nostr::Metadata::new().name(name))
@@ -95,7 +95,7 @@ pub static TEST_KEY_2_NPUB: &str =
95pub static TEST_KEY_2_DISPLAY_NAME: &str = "carole"; 95pub static TEST_KEY_2_DISPLAY_NAME: &str = "carole";
96pub static TEST_KEY_2_ENCRYPTED: &str = "...2"; 96pub static TEST_KEY_2_ENCRYPTED: &str = "...2";
97pub static TEST_KEY_2_KEYS: Lazy<nostr::Keys> = 97pub static TEST_KEY_2_KEYS: Lazy<nostr::Keys> =
98 Lazy::new(|| nostr::Keys::from_sk_str(TEST_KEY_2_NSEC).unwrap()); 98 Lazy::new(|| nostr::Keys::from_str(TEST_KEY_2_NSEC).unwrap());
99 99
100pub fn generate_test_key_2_metadata_event(name: &str) -> nostr::Event { 100pub fn generate_test_key_2_metadata_event(name: &str) -> nostr::Event {
101 nostr::event::EventBuilder::metadata(&nostr::Metadata::new().name(name)) 101 nostr::event::EventBuilder::metadata(&nostr::Metadata::new().name(name))