upleb.uk

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

summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-04-01 14:31:34 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2025-04-01 14:35:50 +0100
commit948fe972eb2bddf187b79f2673a091b6331cfd90 (patch)
treeec1c538d28108b104b5a00afd673631538f9aa00 /tests
parent70966d571fce16f707725c6b0af0fd585bfce607 (diff)
chore: bump rust-nostr v0.37 ~> v0.40
and fix all of the breaking changes
Diffstat (limited to 'tests')
-rw-r--r--tests/git_remote_nostr/main.rs12
-rw-r--r--tests/ngit_init.rs12
-rw-r--r--tests/ngit_list.rs15
3 files changed, 24 insertions, 15 deletions
diff --git a/tests/git_remote_nostr/main.rs b/tests/git_remote_nostr/main.rs
index 686a5df..6b51825 100644
--- a/tests/git_remote_nostr/main.rs
+++ b/tests/git_remote_nostr/main.rs
@@ -3,7 +3,7 @@ use std::{collections::HashSet, env::current_dir};
3use anyhow::{Context, Result}; 3use anyhow::{Context, Result};
4use futures::join; 4use futures::join;
5use git2::Oid; 5use git2::Oid;
6use nostr::nips::nip01::Coordinate; 6use nostr::nips::{nip01::Coordinate, nip19::Nip19Coordinate};
7use nostr_sdk::{Event, JsonUtil, Kind, RelayUrl, ToBech32, secp256k1::rand}; 7use nostr_sdk::{Event, JsonUtil, Kind, RelayUrl, ToBech32, secp256k1::rand};
8use relay::Relay; 8use relay::Relay;
9use serial_test::serial; 9use serial_test::serial;
@@ -18,10 +18,12 @@ static STATE_KIND: nostr::Kind = Kind::Custom(30618);
18 18
19fn get_nostr_remote_url() -> Result<String> { 19fn get_nostr_remote_url() -> Result<String> {
20 let repo_event = generate_repo_ref_event(); 20 let repo_event = generate_repo_ref_event();
21 let naddr = Coordinate { 21 let naddr = Nip19Coordinate {
22 kind: Kind::GitRepoAnnouncement, 22 coordinate: Coordinate {
23 public_key: repo_event.pubkey, 23 kind: Kind::GitRepoAnnouncement,
24 identifier: repo_event.tags.identifier().unwrap().to_string(), 24 public_key: repo_event.pubkey,
25 identifier: repo_event.tags.identifier().unwrap().to_string(),
26 },
25 relays: vec![ 27 relays: vec![
26 RelayUrl::parse("ws://localhost:8055").unwrap(), 28 RelayUrl::parse("ws://localhost:8055").unwrap(),
27 RelayUrl::parse("ws://localhost:8056").unwrap(), 29 RelayUrl::parse("ws://localhost:8056").unwrap(),
diff --git a/tests/ngit_init.rs b/tests/ngit_init.rs
index 4b61559..409bd51 100644
--- a/tests/ngit_init.rs
+++ b/tests/ngit_init.rs
@@ -194,7 +194,7 @@ mod when_repo_not_previously_claimed {
194 194
195 mod git_config_updated { 195 mod git_config_updated {
196 196
197 use nostr::nips::nip01::Coordinate; 197 use nostr::nips::{nip01::Coordinate, nip19::Nip19Coordinate};
198 use nostr_sdk::ToBech32; 198 use nostr_sdk::ToBech32;
199 199
200 use super::*; 200 use super::*;
@@ -236,10 +236,12 @@ mod when_repo_not_previously_claimed {
236 .get_entry("nostr.repo")? 236 .get_entry("nostr.repo")?
237 .value() 237 .value()
238 .unwrap(), 238 .unwrap(),
239 Coordinate { 239 Nip19Coordinate {
240 kind: nostr_sdk::Kind::GitRepoAnnouncement, 240 coordinate: Coordinate {
241 identifier: "example-identifier".to_string(), 241 kind: nostr_sdk::Kind::GitRepoAnnouncement,
242 public_key: TEST_KEY_1_KEYS.public_key(), 242 identifier: "example-identifier".to_string(),
243 public_key: TEST_KEY_1_KEYS.public_key(),
244 },
243 relays: vec![], 245 relays: vec![],
244 } 246 }
245 .to_bech32()?, 247 .to_bech32()?,
diff --git a/tests/ngit_list.rs b/tests/ngit_list.rs
index 4a3aad5..bb742cf 100644
--- a/tests/ngit_list.rs
+++ b/tests/ngit_list.rs
@@ -49,7 +49,10 @@ async fn prep_proposals_repo_and_repo_with_proposal_pulled_and_checkedout(
49mod cannot_find_repo_event { 49mod cannot_find_repo_event {
50 use super::*; 50 use super::*;
51 mod cli_prompts { 51 mod cli_prompts {
52 use nostr::{ToBech32, nips::nip01::Coordinate}; 52 use nostr::{
53 ToBech32,
54 nips::{nip01::Coordinate, nip19::Nip19Coordinate},
55 };
53 use nostr_sdk::RelayUrl; 56 use nostr_sdk::RelayUrl;
54 57
55 use super::*; 58 use super::*;
@@ -87,10 +90,12 @@ mod cannot_find_repo_event {
87 } 90 }
88 if naddr { 91 if naddr {
89 let mut input = p.expect_input("nostr repository")?; 92 let mut input = p.expect_input("nostr repository")?;
90 let coordinate = Coordinate { 93 let coordinate = Nip19Coordinate {
91 kind: nostr::Kind::GitRepoAnnouncement, 94 coordinate: Coordinate {
92 public_key: TEST_KEY_1_KEYS.public_key(), 95 kind: nostr::Kind::GitRepoAnnouncement,
93 identifier: repo_event.tags.identifier().unwrap().to_string(), 96 public_key: TEST_KEY_1_KEYS.public_key(),
97 identifier: repo_event.tags.identifier().unwrap().to_string(),
98 },
94 relays: vec![RelayUrl::parse("ws://localhost:8056").unwrap()], 99 relays: vec![RelayUrl::parse("ws://localhost:8056").unwrap()],
95 }; 100 };
96 input.succeeds_with(&coordinate.to_bech32()?)?; 101 input.succeeds_with(&coordinate.to_bech32()?)?;