Skip to content

Commit

Permalink
refactor: remove left over blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
thesimplekid committed Mar 31, 2024
1 parent 35ce004 commit c704f43
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
4 changes: 1 addition & 3 deletions crates/cashu-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"] }
Expand Down
18 changes: 0 additions & 18 deletions crates/cashu-sdk/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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)
}

0 comments on commit c704f43

Please sign in to comment.