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/login.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/login.rs')
| -rw-r--r-- | src/login.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/login.rs b/src/login.rs index b0fe230..4cdf3c1 100644 --- a/src/login.rs +++ b/src/login.rs | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | use std::str::FromStr; | ||
| 2 | |||
| 1 | use anyhow::{bail, Context, Result}; | 3 | use anyhow::{bail, Context, Result}; |
| 2 | use nostr::{prelude::FromSkStr, secp256k1::XOnlyPublicKey}; | 4 | use nostr::PublicKey; |
| 3 | use zeroize::Zeroize; | 5 | use zeroize::Zeroize; |
| 4 | 6 | ||
| 5 | #[cfg(not(test))] | 7 | #[cfg(not(test))] |
| @@ -25,7 +27,7 @@ pub async fn launch( | |||
| 25 | // if nsec parameter | 27 | // if nsec parameter |
| 26 | let key = if let Some(nsec_unwrapped) = nsec { | 28 | let key = if let Some(nsec_unwrapped) = nsec { |
| 27 | // get key or fail without prompts | 29 | // get key or fail without prompts |
| 28 | let key = nostr::Keys::from_sk_str(nsec_unwrapped).context("invalid nsec parameter")?; | 30 | let key = nostr::Keys::from_str(nsec_unwrapped).context("invalid nsec parameter")?; |
| 29 | 31 | ||
| 30 | // if password, add user to enable password login in future | 32 | // if password, add user to enable password login in future |
| 31 | if password.is_some() { | 33 | if password.is_some() { |
| @@ -91,7 +93,7 @@ pub async fn launch( | |||
| 91 | } | 93 | } |
| 92 | 94 | ||
| 93 | async fn get_user_details( | 95 | async fn get_user_details( |
| 94 | public_key: &XOnlyPublicKey, | 96 | public_key: &PublicKey, |
| 95 | #[cfg(test)] client: &crate::client::MockConnect, | 97 | #[cfg(test)] client: &crate::client::MockConnect, |
| 96 | #[cfg(not(test))] client: &Client, | 98 | #[cfg(not(test))] client: &Client, |
| 97 | ) -> Result<UserRef> { | 99 | ) -> Result<UserRef> { |