mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-20 06:05:09 +01:00
Introduce cashu to host the shared types, traits and other common code (#519)
--------- Co-authored-by: thesimplekid <tsk@thesimplekid.com>
This commit is contained in:
34
crates/cdk-common/src/database/mod.rs
Normal file
34
crates/cdk-common/src/database/mod.rs
Normal file
@@ -0,0 +1,34 @@
|
||||
//! CDK Database
|
||||
|
||||
#[cfg(feature = "mint")]
|
||||
mod mint;
|
||||
#[cfg(feature = "wallet")]
|
||||
mod wallet;
|
||||
|
||||
#[cfg(feature = "mint")]
|
||||
pub use mint::Database as MintDatabase;
|
||||
#[cfg(feature = "wallet")]
|
||||
pub use wallet::Database as WalletDatabase;
|
||||
|
||||
/// CDK_database error
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum Error {
|
||||
/// Database Error
|
||||
#[error(transparent)]
|
||||
Database(Box<dyn std::error::Error + Send + Sync>),
|
||||
/// DHKE error
|
||||
#[error(transparent)]
|
||||
DHKE(#[from] crate::dhke::Error),
|
||||
/// NUT00 Error
|
||||
#[error(transparent)]
|
||||
NUT00(#[from] crate::nuts::nut00::Error),
|
||||
/// NUT02 Error
|
||||
#[error(transparent)]
|
||||
NUT02(#[from] crate::nuts::nut02::Error),
|
||||
/// Serde Error
|
||||
#[error(transparent)]
|
||||
Serde(#[from] serde_json::Error),
|
||||
/// Unknown Quote
|
||||
#[error("Unknown Quote")]
|
||||
UnknownQuote,
|
||||
}
|
||||
Reference in New Issue
Block a user