cdk_common/database/
mod.rs1#[cfg(feature = "mint")]
4mod mint;
5#[cfg(feature = "wallet")]
6mod wallet;
7
8#[cfg(feature = "mint")]
9pub use mint::Database as MintDatabase;
10#[cfg(all(feature = "mint", feature = "auth"))]
11pub use mint::MintAuthDatabase;
12#[cfg(feature = "wallet")]
13pub use wallet::Database as WalletDatabase;
14
15#[derive(Debug, thiserror::Error)]
17pub enum Error {
18 #[error(transparent)]
20 Database(Box<dyn std::error::Error + Send + Sync>),
21 #[error(transparent)]
23 DHKE(#[from] crate::dhke::Error),
24 #[error(transparent)]
26 NUT00(#[from] crate::nuts::nut00::Error),
27 #[error(transparent)]
29 NUT02(#[from] crate::nuts::nut02::Error),
30 #[error(transparent)]
32 #[cfg(feature = "auth")]
33 NUT22(#[from] crate::nuts::nut22::Error),
34 #[error(transparent)]
36 Serde(#[from] serde_json::Error),
37 #[error("Unknown Quote")]
39 UnknownQuote,
40 #[error("Attempt to remove spent proof")]
42 AttemptRemoveSpentProof,
43 #[error("Attempt to update state of spent proof")]
45 AttemptUpdateSpentProof,
46 #[error("Proof not found")]
48 ProofNotFound,
49 #[error("Unknown or invalid keyset")]
51 InvalidKeysetId,
52}