mirror of
https://github.com/aljazceru/cdk.git
synced 2026-02-05 05:06:14 +01:00
refactor: wallet localstore mod
This commit is contained in:
@@ -11,7 +11,6 @@ use tokio::runtime::Runtime;
|
||||
#[cfg(feature = "wallet")]
|
||||
pub mod client;
|
||||
|
||||
mod localstore;
|
||||
#[cfg(feature = "mint")]
|
||||
pub mod mint;
|
||||
pub mod utils;
|
||||
@@ -20,8 +19,6 @@ pub mod wallet;
|
||||
|
||||
pub use bip39::Mnemonic;
|
||||
pub use cashu::{self, *};
|
||||
#[cfg(all(not(target_arch = "wasm32"), feature = "redb"))]
|
||||
pub use localstore::redb_store::RedbLocalStore;
|
||||
|
||||
#[cfg(feature = "blocking")]
|
||||
static RUNTIME: Lazy<Runtime> = Lazy::new(|| Runtime::new().expect("Can't start Tokio runtime"));
|
||||
|
||||
@@ -9,6 +9,8 @@ use async_trait::async_trait;
|
||||
use cashu::nuts::{Id, KeySetInfo, Keys, MintInfo, Proofs};
|
||||
use cashu::types::{MeltQuote, MintQuote};
|
||||
use cashu::url::UncheckedUrl;
|
||||
#[cfg(all(not(target_arch = "wasm32"), feature = "redb"))]
|
||||
pub use redb_store::RedbLocalStore;
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
@@ -15,13 +15,15 @@ use cashu::types::ProofsStatus;
|
||||
use cashu::types::{MeltQuote, Melted, MintQuote};
|
||||
use cashu::url::UncheckedUrl;
|
||||
use cashu::{Amount, Bolt11Invoice};
|
||||
use localstore::LocalStore;
|
||||
use thiserror::Error;
|
||||
use tracing::warn;
|
||||
|
||||
use crate::client::Client;
|
||||
use crate::localstore::LocalStore;
|
||||
use crate::utils::unix_time;
|
||||
|
||||
pub mod localstore;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum Error {
|
||||
/// Insufficient Funds
|
||||
@@ -39,7 +41,7 @@ pub enum Error {
|
||||
#[error("Quote Unknown")]
|
||||
QuoteUnknown,
|
||||
#[error("`{0}`")]
|
||||
LocalStore(#[from] super::localstore::Error),
|
||||
LocalStore(#[from] localstore::Error),
|
||||
#[error("`{0}`")]
|
||||
Custom(String),
|
||||
}
|
||||
Reference in New Issue
Block a user