From 30f1a3efa9265b1403a7aa68fffbd65291face3d Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 11 Nov 2024 13:08:35 +0000 Subject: chore: bump rust-nostr v0.36 bump all rust-nostr packages to latest issued version. there have been some breaking changes to nip46 and this applies these changes. --- src/bin/git_remote_nostr/push.rs | 11 +++++------ src/bin/ngit/sub_commands/init.rs | 17 ++++++++++------- 2 files changed, 15 insertions(+), 13 deletions(-) (limited to 'src/bin') diff --git a/src/bin/git_remote_nostr/push.rs b/src/bin/git_remote_nostr/push.rs index 8fc8349..91c901a 100644 --- a/src/bin/git_remote_nostr/push.rs +++ b/src/bin/git_remote_nostr/push.rs @@ -29,9 +29,8 @@ use ngit::{ }; use nostr::nips::nip10::Marker; use nostr_sdk::{ - hashes::sha1::Hash as Sha1Hash, Event, EventBuilder, EventId, Kind, PublicKey, Tag, + hashes::sha1::Hash as Sha1Hash, Event, EventBuilder, EventId, Kind, NostrSigner, PublicKey, Tag, }; -use nostr_signer::NostrSigner; use repo_ref::RepoRef; use repo_state::RepoState; @@ -876,7 +875,7 @@ async fn get_merged_status_events( repo_ref: &RepoRef, git_repo: &Repo, remote_nostr_url: &str, - signer: &NostrSigner, + signer: &Arc, refspecs_to_git_server: &Vec, ) -> Result> { let mut events = vec![]; @@ -952,7 +951,7 @@ async fn get_merged_status_events( } async fn create_merge_status( - signer: &NostrSigner, + signer: &Arc, repo_ref: &RepoRef, proposal: &Event, revision: &Option, @@ -1194,14 +1193,14 @@ trait BuildRepoState { async fn build( identifier: String, state: HashMap, - signer: &NostrSigner, + signer: &Arc, ) -> Result; } impl BuildRepoState for RepoState { async fn build( identifier: String, state: HashMap, - signer: &NostrSigner, + signer: &Arc, ) -> Result { let mut tags = vec![Tag::identifier(identifier.clone())]; for (name, value) in &state { diff --git a/src/bin/ngit/sub_commands/init.rs b/src/bin/ngit/sub_commands/init.rs index 1d6d0e9..aa43106 100644 --- a/src/bin/ngit/sub_commands/init.rs +++ b/src/bin/ngit/sub_commands/init.rs @@ -215,7 +215,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { let mut maintainers_string = if !args.other_maintainers.is_empty() { [args.other_maintainers.clone()].concat().join(" ") } else if repo_ref.is_none() && repo_config_result.is_err() { - signer.public_key().await?.to_bech32()? + signer.get_public_key().await?.to_bech32()? } else { let maintainers = if let Ok(config) = &repo_config_result { config.maintainers.clone() @@ -228,7 +228,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { .collect() } else { //unreachable - vec![signer.public_key().await?.to_bech32()?] + vec![signer.get_public_key().await?.to_bech32()?] }; // add current user if not present if maintainers.iter().any(|m| { @@ -240,15 +240,18 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { }) { maintainers.join(" ") } else { - [maintainers, vec![signer.public_key().await?.to_bech32()?]] - .concat() - .join(" ") + [ + maintainers, + vec![signer.get_public_key().await?.to_bech32()?], + ] + .concat() + .join(" ") } }; 'outer: loop { if !dont_ask && signer - .public_key() + .get_public_key() .await? .to_bech32()? .eq(&maintainers_string) @@ -302,7 +305,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { } // add current user incase removed if !maintainers.iter().any(|m| user_ref.public_key.eq(m)) { - maintainers.push(signer.public_key().await?); + maintainers.push(signer.get_public_key().await?); } break maintainers; } -- cgit v1.2.3