From 948fe972eb2bddf187b79f2673a091b6331cfd90 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 1 Apr 2025 14:31:34 +0100 Subject: chore: bump rust-nostr v0.37 ~> v0.40 and fix all of the breaking changes --- tests/git_remote_nostr/main.rs | 12 +++++++----- tests/ngit_init.rs | 12 +++++++----- tests/ngit_list.rs | 15 ++++++++++----- 3 files changed, 24 insertions(+), 15 deletions(-) (limited to 'tests') 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}; use anyhow::{Context, Result}; use futures::join; use git2::Oid; -use nostr::nips::nip01::Coordinate; +use nostr::nips::{nip01::Coordinate, nip19::Nip19Coordinate}; use nostr_sdk::{Event, JsonUtil, Kind, RelayUrl, ToBech32, secp256k1::rand}; use relay::Relay; use serial_test::serial; @@ -18,10 +18,12 @@ static STATE_KIND: nostr::Kind = Kind::Custom(30618); fn get_nostr_remote_url() -> Result { let repo_event = generate_repo_ref_event(); - let naddr = Coordinate { - kind: Kind::GitRepoAnnouncement, - public_key: repo_event.pubkey, - identifier: repo_event.tags.identifier().unwrap().to_string(), + let naddr = Nip19Coordinate { + coordinate: Coordinate { + kind: Kind::GitRepoAnnouncement, + public_key: repo_event.pubkey, + identifier: repo_event.tags.identifier().unwrap().to_string(), + }, relays: vec![ RelayUrl::parse("ws://localhost:8055").unwrap(), 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 { mod git_config_updated { - use nostr::nips::nip01::Coordinate; + use nostr::nips::{nip01::Coordinate, nip19::Nip19Coordinate}; use nostr_sdk::ToBech32; use super::*; @@ -236,10 +236,12 @@ mod when_repo_not_previously_claimed { .get_entry("nostr.repo")? .value() .unwrap(), - Coordinate { - kind: nostr_sdk::Kind::GitRepoAnnouncement, - identifier: "example-identifier".to_string(), - public_key: TEST_KEY_1_KEYS.public_key(), + Nip19Coordinate { + coordinate: Coordinate { + kind: nostr_sdk::Kind::GitRepoAnnouncement, + identifier: "example-identifier".to_string(), + public_key: TEST_KEY_1_KEYS.public_key(), + }, relays: vec![], } .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( mod cannot_find_repo_event { use super::*; mod cli_prompts { - use nostr::{ToBech32, nips::nip01::Coordinate}; + use nostr::{ + ToBech32, + nips::{nip01::Coordinate, nip19::Nip19Coordinate}, + }; use nostr_sdk::RelayUrl; use super::*; @@ -87,10 +90,12 @@ mod cannot_find_repo_event { } if naddr { let mut input = p.expect_input("nostr repository")?; - let coordinate = Coordinate { - kind: nostr::Kind::GitRepoAnnouncement, - public_key: TEST_KEY_1_KEYS.public_key(), - identifier: repo_event.tags.identifier().unwrap().to_string(), + let coordinate = Nip19Coordinate { + coordinate: Coordinate { + kind: nostr::Kind::GitRepoAnnouncement, + public_key: TEST_KEY_1_KEYS.public_key(), + identifier: repo_event.tags.identifier().unwrap().to_string(), + }, relays: vec![RelayUrl::parse("ws://localhost:8056").unwrap()], }; input.succeeds_with(&coordinate.to_bech32()?)?; -- cgit v1.2.3