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/ngit/sub_commands/init.rs | 21 +++++++++++++-------- src/bin/ngit/sub_commands/send.rs | 8 +++++++- 2 files changed, 20 insertions(+), 9 deletions(-) (limited to 'src/bin/ngit') diff --git a/src/bin/ngit/sub_commands/init.rs b/src/bin/ngit/sub_commands/init.rs index 4aa7ced..3731e3a 100644 --- a/src/bin/ngit/sub_commands/init.rs +++ b/src/bin/ngit/sub_commands/init.rs @@ -11,6 +11,7 @@ use nostr::{ nips::{ nip01::Coordinate, nip05::{self}, + nip19::Nip19Coordinate, }, }; use nostr_sdk::{Kind, RelayUrl}; @@ -437,10 +438,12 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { // TODO - does this git config item do more harm than good? git_repo.save_git_config_item( "nostr.repo", - &Coordinate { - kind: Kind::GitRepoAnnouncement, - public_key: user_ref.public_key, - identifier: identifier.clone(), + &Nip19Coordinate { + coordinate: Coordinate { + kind: Kind::GitRepoAnnouncement, + public_key: user_ref.public_key, + identifier: identifier.clone(), + }, relays: vec![], } .to_bech32()?, @@ -471,10 +474,12 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { repo_ref.set_nostr_git_url(NostrUrlDecoded { original_string: String::new(), nip05: Some(nip05.clone()), - coordinate: Coordinate { - kind: Kind::GitRepoAnnouncement, - public_key: user_ref.public_key, - identifier: repo_ref.identifier.clone(), + coordinate: Nip19Coordinate { + coordinate: Coordinate { + kind: Kind::GitRepoAnnouncement, + public_key: user_ref.public_key, + identifier: repo_ref.identifier.clone(), + }, relays: if inter.next().is_some() || relays.is_empty() { vec![] } else { diff --git a/src/bin/ngit/sub_commands/send.rs b/src/bin/ngit/sub_commands/send.rs index 7c898bc..9fc00d9 100644 --- a/src/bin/ngit/sub_commands/send.rs +++ b/src/bin/ngit/sub_commands/send.rs @@ -238,7 +238,13 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs, no_fetch: bool) -> Re if root_proposal_id.is_none() { if let Some(event) = events.first() { let event_bech32 = if let Some(relay) = repo_ref.relays.first() { - Nip19Event::new(event.id, vec![relay.to_string()]).to_bech32()? + Nip19Event { + event_id: event.id, + relays: vec![relay.clone()], + author: None, + kind: None, + } + .to_bech32()? } else { event.id.to_bech32()? }; -- cgit v1.2.3