Skip to content

Commit ef465f8

Browse files
committed
nostr: impl Any for NostrSigner
This allows downcasting `Arc<dyn NostrSigner` to `Keys` or other concrete signer types. Pull-Request: #845 Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent 078cfdd commit ef465f8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727

2828
## Unreleased
2929

30+
### Changed
31+
32+
* nostr: impl `Any` for `NostrSigner` ([Yuki Kishimoto] at https://github.com/rust-nostr/nostr/pull/845)
33+
3034
### Added
3135

3236
* blossom: add new crate with Blossom support ([Daniel D’Aquino] at https://github.com/rust-nostr/nostr/pull/838)

crates/nostr/src/signer.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
//! Nostr Signer
66
7+
use core::any::Any;
78
use alloc::borrow::Cow;
89
use alloc::string::String;
910
use alloc::sync::Arc;
10-
use core::fmt;
11+
use core::fmt::{self, Debug};
1112

1213
use crate::util::BoxedFuture;
1314
use crate::{Event, PublicKey, UnsignedEvent};
@@ -88,7 +89,7 @@ pub enum SignerBackend<'a> {
8889
}
8990

9091
/// Nostr signer abstraction
91-
pub trait NostrSigner: fmt::Debug + Send + Sync {
92+
pub trait NostrSigner: Any + Debug + Send + Sync {
9293
/// Signer backend
9394
fn backend(&self) -> SignerBackend;
9495

0 commit comments

Comments
 (0)