mirror of
https://github.com/aljazceru/cdk.git
synced 2026-02-05 05:06:14 +01:00
refactor: remove left over blocking
This commit is contained in:
@@ -12,7 +12,7 @@ license.workspace = true
|
||||
[features]
|
||||
default = ["mint", "wallet", "all-nuts", "redb"]
|
||||
mint = ["cashu/mint"]
|
||||
wallet = ["cashu/wallet", "dep:minreq", "dep:once_cell"]
|
||||
wallet = ["cashu/wallet", "dep:minreq"]
|
||||
gloo = ["dep:gloo"]
|
||||
all-nuts = ["nut07", "nut08", "nut09", "nut10", "nut11", "nut12", "nut13"]
|
||||
nut07 = ["cashu/nut07"]
|
||||
@@ -32,8 +32,6 @@ serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
url = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
futures-util = { version = "0.3", default-features = false, features = ["sink", "std"] }
|
||||
once_cell = { version = "1.17", optional = true }
|
||||
thiserror = { workspace = true }
|
||||
async-trait = "0.1.74"
|
||||
gloo = { version = "0.11.0", optional = true, features = ["net"] }
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
#[cfg(all(target_arch = "wasm32", feature = "blocking"))]
|
||||
compile_error!("`blocking` feature can't be enabled for WASM targets");
|
||||
|
||||
#[cfg(feature = "blocking")]
|
||||
use futures_util::Future;
|
||||
#[cfg(feature = "blocking")]
|
||||
use once_cell::sync::Lazy;
|
||||
#[cfg(feature = "blocking")]
|
||||
use tokio::runtime::Runtime;
|
||||
|
||||
#[cfg(feature = "wallet")]
|
||||
pub mod client;
|
||||
|
||||
@@ -19,11 +9,3 @@ pub mod wallet;
|
||||
|
||||
pub use bip39::Mnemonic;
|
||||
pub use cashu::{self, *};
|
||||
|
||||
#[cfg(feature = "blocking")]
|
||||
static RUNTIME: Lazy<Runtime> = Lazy::new(|| Runtime::new().expect("Can't start Tokio runtime"));
|
||||
|
||||
#[cfg(feature = "blocking")]
|
||||
pub fn block_on<F: Future>(future: F) -> F::Output {
|
||||
RUNTIME.block_on(future)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user