diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-11-11 13:08:35 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-11-11 13:08:35 +0000 |
| commit | 30f1a3efa9265b1403a7aa68fffbd65291face3d (patch) | |
| tree | 335ceb627f6ae4a81a74b2bbae3f8cf1a2da2f41 /src/bin | |
| parent | f08ee98ab7e19d4e42ffa85aa619f012441fbe47 (diff) | |
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.
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/git_remote_nostr/push.rs | 11 | ||||
| -rw-r--r-- | src/bin/ngit/sub_commands/init.rs | 17 |
2 files changed, 15 insertions, 13 deletions
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::{ | |||
| 29 | }; | 29 | }; |
| 30 | use nostr::nips::nip10::Marker; | 30 | use nostr::nips::nip10::Marker; |
| 31 | use nostr_sdk::{ | 31 | use nostr_sdk::{ |
| 32 | hashes::sha1::Hash as Sha1Hash, Event, EventBuilder, EventId, Kind, PublicKey, Tag, | 32 | hashes::sha1::Hash as Sha1Hash, Event, EventBuilder, EventId, Kind, NostrSigner, PublicKey, Tag, |
| 33 | }; | 33 | }; |
| 34 | use nostr_signer::NostrSigner; | ||
| 35 | use repo_ref::RepoRef; | 34 | use repo_ref::RepoRef; |
| 36 | use repo_state::RepoState; | 35 | use repo_state::RepoState; |
| 37 | 36 | ||
| @@ -876,7 +875,7 @@ async fn get_merged_status_events( | |||
| 876 | repo_ref: &RepoRef, | 875 | repo_ref: &RepoRef, |
| 877 | git_repo: &Repo, | 876 | git_repo: &Repo, |
| 878 | remote_nostr_url: &str, | 877 | remote_nostr_url: &str, |
| 879 | signer: &NostrSigner, | 878 | signer: &Arc<dyn NostrSigner>, |
| 880 | refspecs_to_git_server: &Vec<String>, | 879 | refspecs_to_git_server: &Vec<String>, |
| 881 | ) -> Result<Vec<Event>> { | 880 | ) -> Result<Vec<Event>> { |
| 882 | let mut events = vec![]; | 881 | let mut events = vec![]; |
| @@ -952,7 +951,7 @@ async fn get_merged_status_events( | |||
| 952 | } | 951 | } |
| 953 | 952 | ||
| 954 | async fn create_merge_status( | 953 | async fn create_merge_status( |
| 955 | signer: &NostrSigner, | 954 | signer: &Arc<dyn NostrSigner>, |
| 956 | repo_ref: &RepoRef, | 955 | repo_ref: &RepoRef, |
| 957 | proposal: &Event, | 956 | proposal: &Event, |
| 958 | revision: &Option<Event>, | 957 | revision: &Option<Event>, |
| @@ -1194,14 +1193,14 @@ trait BuildRepoState { | |||
| 1194 | async fn build( | 1193 | async fn build( |
| 1195 | identifier: String, | 1194 | identifier: String, |
| 1196 | state: HashMap<String, String>, | 1195 | state: HashMap<String, String>, |
| 1197 | signer: &NostrSigner, | 1196 | signer: &Arc<dyn NostrSigner>, |
| 1198 | ) -> Result<RepoState>; | 1197 | ) -> Result<RepoState>; |
| 1199 | } | 1198 | } |
| 1200 | impl BuildRepoState for RepoState { | 1199 | impl BuildRepoState for RepoState { |
| 1201 | async fn build( | 1200 | async fn build( |
| 1202 | identifier: String, | 1201 | identifier: String, |
| 1203 | state: HashMap<String, String>, | 1202 | state: HashMap<String, String>, |
| 1204 | signer: &NostrSigner, | 1203 | signer: &Arc<dyn NostrSigner>, |
| 1205 | ) -> Result<RepoState> { | 1204 | ) -> Result<RepoState> { |
| 1206 | let mut tags = vec![Tag::identifier(identifier.clone())]; | 1205 | let mut tags = vec![Tag::identifier(identifier.clone())]; |
| 1207 | for (name, value) in &state { | 1206 | 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<()> { | |||
| 215 | let mut maintainers_string = if !args.other_maintainers.is_empty() { | 215 | let mut maintainers_string = if !args.other_maintainers.is_empty() { |
| 216 | [args.other_maintainers.clone()].concat().join(" ") | 216 | [args.other_maintainers.clone()].concat().join(" ") |
| 217 | } else if repo_ref.is_none() && repo_config_result.is_err() { | 217 | } else if repo_ref.is_none() && repo_config_result.is_err() { |
| 218 | signer.public_key().await?.to_bech32()? | 218 | signer.get_public_key().await?.to_bech32()? |
| 219 | } else { | 219 | } else { |
| 220 | let maintainers = if let Ok(config) = &repo_config_result { | 220 | let maintainers = if let Ok(config) = &repo_config_result { |
| 221 | config.maintainers.clone() | 221 | config.maintainers.clone() |
| @@ -228,7 +228,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 228 | .collect() | 228 | .collect() |
| 229 | } else { | 229 | } else { |
| 230 | //unreachable | 230 | //unreachable |
| 231 | vec![signer.public_key().await?.to_bech32()?] | 231 | vec![signer.get_public_key().await?.to_bech32()?] |
| 232 | }; | 232 | }; |
| 233 | // add current user if not present | 233 | // add current user if not present |
| 234 | if maintainers.iter().any(|m| { | 234 | if maintainers.iter().any(|m| { |
| @@ -240,15 +240,18 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 240 | }) { | 240 | }) { |
| 241 | maintainers.join(" ") | 241 | maintainers.join(" ") |
| 242 | } else { | 242 | } else { |
| 243 | [maintainers, vec![signer.public_key().await?.to_bech32()?]] | 243 | [ |
| 244 | .concat() | 244 | maintainers, |
| 245 | .join(" ") | 245 | vec![signer.get_public_key().await?.to_bech32()?], |
| 246 | ] | ||
| 247 | .concat() | ||
| 248 | .join(" ") | ||
| 246 | } | 249 | } |
| 247 | }; | 250 | }; |
| 248 | 'outer: loop { | 251 | 'outer: loop { |
| 249 | if !dont_ask | 252 | if !dont_ask |
| 250 | && signer | 253 | && signer |
| 251 | .public_key() | 254 | .get_public_key() |
| 252 | .await? | 255 | .await? |
| 253 | .to_bech32()? | 256 | .to_bech32()? |
| 254 | .eq(&maintainers_string) | 257 | .eq(&maintainers_string) |
| @@ -302,7 +305,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 302 | } | 305 | } |
| 303 | // add current user incase removed | 306 | // add current user incase removed |
| 304 | if !maintainers.iter().any(|m| user_ref.public_key.eq(m)) { | 307 | if !maintainers.iter().any(|m| user_ref.public_key.eq(m)) { |
| 305 | maintainers.push(signer.public_key().await?); | 308 | maintainers.push(signer.get_public_key().await?); |
| 306 | } | 309 | } |
| 307 | break maintainers; | 310 | break maintainers; |
| 308 | } | 311 | } |