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:
Diffstat (limited to 'test_utils')
-rw-r--r--test_utils/Cargo.toml8
-rw-r--r--test_utils/src/lib.rs2
-rw-r--r--test_utils/src/relay.rs7
3 files changed, 10 insertions, 7 deletions
diff --git a/test_utils/Cargo.toml b/test_utils/Cargo.toml
index 016cc19..e7f5e05 100644
--- a/test_utils/Cargo.toml
+++ b/test_utils/Cargo.toml
@@ -10,10 +10,10 @@ dialoguer = "0.12.0"
10directories = "6.0.0" 10directories = "6.0.0"
11futures = "0.3.31" 11futures = "0.3.31"
12git2 = "0.20.2" 12git2 = "0.20.2"
13nostr = "0.43.0" 13nostr = "0.44.1"
14nostr-database = "0.43.0" 14nostr-database = "0.44.0"
15nostr-lmdb = "0.43.0" 15nostr-lmdb = "0.44.0"
16nostr-sdk = "0.43.0" 16nostr-sdk = "0.44.1"
17once_cell = "1.21.3" 17once_cell = "1.21.3"
18rand = "0.9" 18rand = "0.9"
19rexpect = { git = "https://github.com/rust-cli/rexpect.git", rev = "9eb61dd" } 19rexpect = { 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 22bdf90..bdfc550 100644
--- a/test_utils/src/lib.rs
+++ b/test_utils/src/lib.rs
@@ -135,7 +135,7 @@ pub fn make_event_old_or_change_user(
135 .build(keys.public_key()); 135 .build(keys.public_key());
136 136
137 unsigned.created_at = 137 unsigned.created_at =
138 nostr::types::Timestamp::from(nostr::types::Timestamp::now().as_u64() - how_old_in_secs); 138 nostr::types::Timestamp::from(nostr::types::Timestamp::now().as_secs() - how_old_in_secs);
139 unsigned.id = Some(nostr::EventId::new( 139 unsigned.id = Some(nostr::EventId::new(
140 &keys.public_key(), 140 &keys.public_key(),
141 &unsigned.created_at, 141 &unsigned.created_at,
diff --git a/test_utils/src/relay.rs b/test_utils/src/relay.rs
index 313e824..9582bfd 100644
--- a/test_utils/src/relay.rs
+++ b/test_utils/src/relay.rs
@@ -219,10 +219,13 @@ fn get_nreq(
219 let cm_result = ClientMessage::from_json(s); 219 let cm_result = ClientMessage::from_json(s);
220 if let Ok(ClientMessage::Req { 220 if let Ok(ClientMessage::Req {
221 subscription_id, 221 subscription_id,
222 filter, 222 filters,
223 }) = cm_result 223 }) = cm_result
224 { 224 {
225 return Ok((subscription_id.into_owned(), filter.into_owned())); 225 return Ok((
226 subscription_id.into_owned(),
227 filters.into_iter().next().unwrap().into_owned(),
228 ));
226 } 229 }
227 } 230 }
228 bail!("not nostr event") 231 bail!("not nostr event")