diff --git a/CHANGELOG.md b/CHANGELOG.md index 460a902b5..76c014810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ * nostr: change `Keys::secret_key` and `Keys::sign_schnorr` methods fingerprint ([Yuki Kishimoto]) * nostr: deprecate `Keys::generate_without_keypair` ([Yuki Kishimoto]) * nostr: change NIP-26 functions fingerprint ([Yuki Kishimoto]) +* database: update `NostrDatabase` supertraits ([Yuki Kishimoto]) * signer: update NIP-04 and NIP-44 methods signature ([Yuki Kishimoto]) * webln: bump `webln` to `v0.3` ([Yuki Kishimoto]) * sdk: bump `lnurl-pay` to `v0.6` ([Yuki Kishimoto]) diff --git a/crates/nostr-database/src/lib.rs b/crates/nostr-database/src/lib.rs index 09c7ed5a6..087eccab6 100644 --- a/crates/nostr-database/src/lib.rs +++ b/crates/nostr-database/src/lib.rs @@ -102,7 +102,7 @@ where /// Nostr Database #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] #[cfg_attr(not(target_arch = "wasm32"), async_trait)] -pub trait NostrDatabase: AsyncTraitDeps { +pub trait NostrDatabase: fmt::Debug + Send + Sync { /// Error type Err: From + Into; @@ -357,37 +357,3 @@ impl NostrDatabase for EraseNostrDatabaseError { self.0.wipe().await.map_err(Into::into) } } - -/// Alias for `Send` on non-wasm, empty trait (implemented by everything) on -/// wasm. -#[cfg(not(target_arch = "wasm32"))] -pub trait SendOutsideWasm: Send {} -#[cfg(not(target_arch = "wasm32"))] -impl SendOutsideWasm for T {} - -/// Alias for `Send` on non-wasm, empty trait (implemented by everything) on -/// wasm. -#[cfg(target_arch = "wasm32")] -pub trait SendOutsideWasm {} -#[cfg(target_arch = "wasm32")] -impl SendOutsideWasm for T {} - -/// Alias for `Sync` on non-wasm, empty trait (implemented by everything) on -/// wasm. -#[cfg(not(target_arch = "wasm32"))] -pub trait SyncOutsideWasm: Sync {} -#[cfg(not(target_arch = "wasm32"))] -impl SyncOutsideWasm for T {} - -/// Alias for `Sync` on non-wasm, empty trait (implemented by everything) on -/// wasm. -#[cfg(target_arch = "wasm32")] -pub trait SyncOutsideWasm {} -#[cfg(target_arch = "wasm32")] -impl SyncOutsideWasm for T {} - -/// Super trait that is used for our store traits, this trait will differ if -/// it's used on WASM. WASM targets will not require `Send` and `Sync` to have -/// implemented, while other targets will. -pub trait AsyncTraitDeps: fmt::Debug + SendOutsideWasm + SyncOutsideWasm {} -impl AsyncTraitDeps for T {}