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 --- src/bin/git_remote_nostr/fetch.rs | 2 +- src/bin/git_remote_nostr/main.rs | 4 ++-- src/bin/git_remote_nostr/push.rs | 17 +++++++++++------ 3 files changed, 14 insertions(+), 9 deletions(-) (limited to 'src/bin/git_remote_nostr') diff --git a/src/bin/git_remote_nostr/fetch.rs b/src/bin/git_remote_nostr/fetch.rs index 5ee4271..a7210d0 100644 --- a/src/bin/git_remote_nostr/fetch.rs +++ b/src/bin/git_remote_nostr/fetch.rs @@ -115,7 +115,7 @@ pub fn make_commits_for_proposal( author: Some(patch.pubkey), kind: Some(patch.kind), relays: if let Some(relay) = repo_ref.relays.first() { - vec![relay.to_string()] + vec![relay.to_owned()] } else { vec![] }, diff --git a/src/bin/git_remote_nostr/main.rs b/src/bin/git_remote_nostr/main.rs index 44359dd..daa924f 100644 --- a/src/bin/git_remote_nostr/main.rs +++ b/src/bin/git_remote_nostr/main.rs @@ -15,7 +15,7 @@ use anyhow::{Context, Result, bail}; use client::{Connect, consolidate_fetch_reports, get_repo_ref_from_cache}; use git::{RepoActions, nostr_url::NostrUrlDecoded}; use ngit::{client, git, login::existing::load_existing_login}; -use nostr::nips::nip01::Coordinate; +use nostr::nips::nip19::Nip19Coordinate; use utils::read_line; use crate::{client::Client, git::Repo}; @@ -148,7 +148,7 @@ async fn process_args() -> Result> { async fn fetching_with_report_for_helper( git_repo_path: &Path, client: &Client, - trusted_maintainer_coordinate: &Coordinate, + trusted_maintainer_coordinate: &Nip19Coordinate, ) -> Result<()> { let term = console::Term::stderr(); term.write_line("nostr: fetching...")?; diff --git a/src/bin/git_remote_nostr/push.rs b/src/bin/git_remote_nostr/push.rs index c0085bd..15adc13 100644 --- a/src/bin/git_remote_nostr/push.rs +++ b/src/bin/git_remote_nostr/push.rs @@ -32,7 +32,7 @@ use ngit::{ }; use nostr::nips::nip10::Marker; use nostr_sdk::{ - Event, EventBuilder, EventId, Kind, NostrSigner, PublicKey, RelayUrl, Tag, + Event, EventBuilder, EventId, Kind, NostrSigner, PublicKey, RelayUrl, Tag, TagStandard, hashes::sha1::Hash as Sha1Hash, }; use repo_ref::RepoRef; @@ -1312,7 +1312,13 @@ async fn create_merge_status( repo_ref .coordinates() .iter() - .map(|c| Tag::coordinate(c.clone())) + .map(|c| { + Tag::from_standardized(TagStandard::Coordinate { + coordinate: c.coordinate.clone(), + relay_url: c.relays.first().cloned(), + uppercase: false, + }) + }) .collect::>(), vec![ Tag::from_standardized(nostr::TagStandard::Reference( @@ -1358,7 +1364,7 @@ async fn get_proposal_and_revision_root_from_patch( patch.clone() } else { let proposal_or_revision_id = EventId::parse( - if let Some(t) = patch.tags.iter().find(|t| t.is_root()) { + &if let Some(t) = patch.tags.iter().find(|t| t.is_root()) { t.clone() } else if let Some(t) = patch.tags.iter().find(|t| t.is_reply()) { t.clone() @@ -1389,13 +1395,12 @@ async fn get_proposal_and_revision_root_from_patch( { Ok(( EventId::parse( - proposal_or_revision + &proposal_or_revision .tags .iter() .find(|t| t.is_reply()) .unwrap() - .as_slice()[1] - .clone(), + .as_slice()[1], )?, Some(proposal_or_revision.id), )) -- cgit v1.2.3