From 9b4dfb937403398b98545141fa32197214a7d555 Mon Sep 17 00:00:00 2001 From: Awiteb Date: Tue, 6 May 2025 11:22:46 +0000 Subject: [PATCH] chore: Returns `Result` public key in `CliOptions::pubkey` Signed-off-by: Awiteb --- src/cli/mod.rs | 4 ++-- src/cli/repo/announce.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 5304f80..8c3be9c 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -115,9 +115,9 @@ impl CommandRunner for Commands { impl CliOptions { /// Gets the public key of the user. - pub async fn pubkey(&self) -> PublicKey { + pub async fn pubkey(&self) -> N34Result { if let Some(sk) = &self.secret_key { - return Keys::new(sk.clone()).public_key(); + return Ok(Keys::new(sk.clone()).public_key()); } unreachable!("There is no other method until now") } diff --git a/src/cli/repo/announce.rs b/src/cli/repo/announce.rs index afecec6..caa61fd 100644 --- a/src/cli/repo/announce.rs +++ b/src/cli/repo/announce.rs @@ -62,7 +62,7 @@ pub struct AnnounceArgs { impl CommandRunner for AnnounceArgs { async fn run(self, options: CliOptions) -> N34Result<()> { let client = NostrClient::init(&options).await; - let user_pubk = options.pubkey().await; + let user_pubk = options.pubkey().await?; let naddr = Nip19Coordinate::new( Coordinate::new(Kind::GitRepoAnnouncement, user_pubk), options.relays.iter().take(3),