diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-03-28 12:35:37 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-03-28 12:35:37 +0000 |
| commit | 4b06b2bd70d37656d727c8fffc0656c1aa3c7b97 (patch) | |
| tree | 1d885fdef21a7530c1a91f848788a665d6fc9948 /src/sub_commands/init.rs | |
| parent | 91a68de459b7d22a8dfb8a324e43740fca3e0a35 (diff) | |
| parent | 11dc9fa2d8b82594d3803f12d2c5a49e57026cfb (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/init.rs')
| -rw-r--r-- | src/sub_commands/init.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sub_commands/init.rs b/src/sub_commands/init.rs index 4f098c0..56129a6 100644 --- a/src/sub_commands/init.rs +++ b/src/sub_commands/init.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | use anyhow::{Context, Result}; | 1 | use anyhow::{Context, Result}; |
| 2 | use nostr::{secp256k1::XOnlyPublicKey, FromBech32, ToBech32}; | 2 | use nostr::{FromBech32, PublicKey, ToBech32}; |
| 3 | 3 | ||
| 4 | use super::send::send_events; | 4 | use super::send::send_events; |
| 5 | #[cfg(not(test))] | 5 | #[cfg(not(test))] |
| @@ -163,7 +163,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 163 | args.web.clone() | 163 | args.web.clone() |
| 164 | }; | 164 | }; |
| 165 | 165 | ||
| 166 | let maintainers: Vec<XOnlyPublicKey> = { | 166 | let maintainers: Vec<PublicKey> = { |
| 167 | let mut dont_ask = !args.other_maintainers.is_empty(); | 167 | let mut dont_ask = !args.other_maintainers.is_empty(); |
| 168 | let mut maintainers_string = if !args.other_maintainers.is_empty() { | 168 | let mut maintainers_string = if !args.other_maintainers.is_empty() { |
| 169 | [args.other_maintainers.clone()].concat().join(" ") | 169 | [args.other_maintainers.clone()].concat().join(" ") |
| @@ -185,7 +185,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 185 | }; | 185 | }; |
| 186 | // add current user if not present | 186 | // add current user if not present |
| 187 | if maintainers.iter().any(|m| { | 187 | if maintainers.iter().any(|m| { |
| 188 | if let Ok(m_pubkey) = XOnlyPublicKey::from_bech32(m) { | 188 | if let Ok(m_pubkey) = PublicKey::from_bech32(m) { |
| 189 | user_ref.public_key.eq(&m_pubkey) | 189 | user_ref.public_key.eq(&m_pubkey) |
| 190 | } else { | 190 | } else { |
| 191 | false | 191 | false |
| @@ -210,9 +210,9 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 210 | .map(std::string::ToString::to_string) | 210 | .map(std::string::ToString::to_string) |
| 211 | .collect(); | 211 | .collect(); |
| 212 | } | 212 | } |
| 213 | let mut maintainers: Vec<XOnlyPublicKey> = vec![]; | 213 | let mut maintainers: Vec<PublicKey> = vec![]; |
| 214 | for m in maintainers_string.split(' ') { | 214 | for m in maintainers_string.split(' ') { |
| 215 | if let Ok(m_pubkey) = XOnlyPublicKey::from_bech32(m) { | 215 | if let Ok(m_pubkey) = PublicKey::from_bech32(m) { |
| 216 | maintainers.push(m_pubkey); | 216 | maintainers.push(m_pubkey); |
| 217 | } else { | 217 | } else { |
| 218 | println!("not a valid set of npubs seperated by a space"); | 218 | println!("not a valid set of npubs seperated by a space"); |