upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/sub_commands/send.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-03-28 12:35:37 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-03-28 12:35:37 +0000
commit4b06b2bd70d37656d727c8fffc0656c1aa3c7b97 (patch)
tree1d885fdef21a7530c1a91f848788a665d6fc9948 /src/sub_commands/send.rs
parent91a68de459b7d22a8dfb8a324e43740fca3e0a35 (diff)
parent11dc9fa2d8b82594d3803f12d2c5a49e57026cfb (diff)
Merge upgrade rust-nostr v0.29
refactor to address breaking changes in rust-nostr fix a number of in dependancy which have been upstreamed
Diffstat (limited to 'src/sub_commands/send.rs')
-rw-r--r--src/sub_commands/send.rs30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs
index 35c2c81..d9caf9b 100644
--- a/src/sub_commands/send.rs
+++ b/src/sub_commands/send.rs
@@ -5,9 +5,10 @@ use console::Style;
5use futures::future::join_all; 5use futures::future::join_all;
6use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; 6use indicatif::{MultiProgress, ProgressBar, ProgressStyle};
7use nostr::{ 7use nostr::{
8 nips::nip19::Nip19, prelude::sha1::Hash as Sha1Hash, EventBuilder, FromBech32, Marker, Tag, 8 nips::{nip01::Coordinate, nip19::Nip19},
9 TagKind, UncheckedUrl, 9 EventBuilder, FromBech32, Marker, Tag, TagKind, UncheckedUrl,
10}; 10};
11use nostr_sdk::hashes::sha1::Hash as Sha1Hash;
11 12
12use super::list::tag_value; 13use super::list::tag_value;
13#[cfg(not(test))] 14#[cfg(not(test))]
@@ -541,11 +542,13 @@ pub fn generate_cover_letter_and_patch_events(
541 vec![ 542 vec![
542 // TODO: why not tag all maintainer identifiers? 543 // TODO: why not tag all maintainer identifiers?
543 Tag::A { 544 Tag::A {
544 kind: nostr::Kind::Custom(REPO_REF_KIND), 545 coordinate: Coordinate {
545 public_key: *repo_ref.maintainers.first() 546 kind: nostr::Kind::Custom(REPO_REF_KIND),
546 .context("repo reference should always have at least one maintainer - the issuer of the repo event") 547 public_key: *repo_ref.maintainers.first()
547 ?, 548 .context("repo reference should always have at least one maintainer")?,
548 identifier: repo_ref.identifier.to_string(), 549 identifier: repo_ref.identifier.to_string(),
550 relays: repo_ref.relays.clone(),
551 },
549 relay_url: repo_ref.relays.first().map(nostr::UncheckedUrl::from).clone(), 552 relay_url: repo_ref.relays.first().map(nostr::UncheckedUrl::from).clone(),
550 }, 553 },
551 Tag::Reference(format!("{root_commit}")), 554 Tag::Reference(format!("{root_commit}")),
@@ -797,11 +800,14 @@ pub fn generate_patch_event(
797 [ 800 [
798 vec![ 801 vec![
799 Tag::A { 802 Tag::A {
800 kind: nostr::Kind::Custom(REPO_REF_KIND), 803 coordinate: Coordinate {
801 public_key: *repo_ref.maintainers.first() 804 kind: nostr::Kind::Custom(REPO_REF_KIND),
802 .context("repo reference should always have at least one maintainer - the issuer of the repo event") 805 public_key: *repo_ref.maintainers.first()
803 ?, 806 .context("repo reference should always have at least one maintainer - the issuer of the repo event")
804 identifier: repo_ref.identifier.to_string(), 807 ?,
808 identifier: repo_ref.identifier.to_string(),
809 relays: repo_ref.relays.clone(),
810 },
805 relay_url: relay_hint.clone(), 811 relay_url: relay_hint.clone(),
806 }, 812 },
807 Tag::Reference(format!("{root_commit}")), 813 Tag::Reference(format!("{root_commit}")),