chore: Returns Result public key in CliOptions::pubkey
Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
@@ -115,9 +115,9 @@ impl CommandRunner for Commands {
|
|||||||
|
|
||||||
impl CliOptions {
|
impl CliOptions {
|
||||||
/// Gets the public key of the user.
|
/// Gets the public key of the user.
|
||||||
pub async fn pubkey(&self) -> PublicKey {
|
pub async fn pubkey(&self) -> N34Result<PublicKey> {
|
||||||
if let Some(sk) = &self.secret_key {
|
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")
|
unreachable!("There is no other method until now")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ pub struct AnnounceArgs {
|
|||||||
impl CommandRunner for AnnounceArgs {
|
impl CommandRunner for AnnounceArgs {
|
||||||
async fn run(self, options: CliOptions) -> N34Result<()> {
|
async fn run(self, options: CliOptions) -> N34Result<()> {
|
||||||
let client = NostrClient::init(&options).await;
|
let client = NostrClient::init(&options).await;
|
||||||
let user_pubk = options.pubkey().await;
|
let user_pubk = options.pubkey().await?;
|
||||||
let naddr = Nip19Coordinate::new(
|
let naddr = Nip19Coordinate::new(
|
||||||
Coordinate::new(Kind::GitRepoAnnouncement, user_pubk),
|
Coordinate::new(Kind::GitRepoAnnouncement, user_pubk),
|
||||||
options.relays.iter().take(3),
|
options.relays.iter().take(3),
|
||||||
|
|||||||
Reference in New Issue
Block a user