refactor: wallet localstore mod

This commit is contained in:
thesimplekid
2024-01-02 19:22:40 +00:00
parent a4b409ee87
commit fd692985dc
5 changed files with 6 additions and 5 deletions

View File

@@ -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"));

View File

@@ -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)]

View File

@@ -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),
}