ci: fix: wasm build

This commit is contained in:
thesimplekid
2023-09-11 21:06:16 +01:00
parent c3437beb6f
commit 544a8d1f91
3 changed files with 11 additions and 6 deletions

View File

@@ -7,6 +7,8 @@ members = [
"bindings/cashu-ffi", "bindings/cashu-ffi",
"bindings/cashu-sdk-ffi" "bindings/cashu-sdk-ffi"
] ]
resolver = "2"
[workspace.package] [workspace.package]
license = "BSD-3-Clause" license = "BSD-3-Clause"
@@ -26,8 +28,8 @@ keywords = ["bitcoin", "e-cash", "cashu"]
serde = { version = "1.0.160", features = ["derive"]} serde = { version = "1.0.160", features = ["derive"]}
serde_json = "1.0.96" serde_json = "1.0.96"
url = "2.3.1" url = "2.3.1"
tokio = { version = "1", default-features = false } tokio = { version = "1.32", default-features = false }
tracing = "0.1" tracing = { version = "0.1", default-features = false }
tracing-subscriber = "0.3" tracing-subscriber = "0.3"
uniffi = "0.24" uniffi = "0.24"

View File

@@ -11,8 +11,8 @@ license.workspace = true
[features] [features]
default = ["mint", "wallet"] default = ["mint", "wallet"]
mint = ["cashu/mint"] mint = ["cashu/mint"]
blocking = ["once_cell"] blocking = ["dep:once_cell"]
wallet = ["cashu/wallet", "minreq", "once_cell"] wallet = ["cashu/wallet", "dep:minreq", "dep:once_cell"]
# Fix: Should be minreq or gloo # Fix: Should be minreq or gloo
@@ -31,13 +31,13 @@ tracing = { workspace = true }
futures-util = { version = "0.3", default-features = false, features = ["sink", "std"] } futures-util = { version = "0.3", default-features = false, features = ["sink", "std"] }
once_cell = { version = "1.17", optional = true } once_cell = { version = "1.17", optional = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { workspace = true, features = ["rt-multi-thread", "time", "macros", "sync"] } tokio = { workspace = true, features = ["rt-multi-thread", "time", "macros", "sync"] }
minreq = { version = "2.7.0", optional = true, features = ["json-using-serde", "https"] } minreq = { version = "2.7.0", optional = true, features = ["json-using-serde", "https"] }
[target.'cfg(target_arch = "wasm32")'.dependencies] [target.'cfg(target_arch = "wasm32")'.dependencies]
tokio = { workspace = true, features = ["rt", "macros", "sync"] } tokio = { workspace = true, features = ["rt", "macros", "sync", "time"] }
gloo = { version = "0.10.0", features = ["net"]} gloo = { version = "0.10.0", features = ["net"]}

View File

@@ -1,3 +1,6 @@
#[cfg(all(target_arch = "wasm32", feature = "blocking"))]
compile_error!("`blocking` feature can't be enabled for WASM targets");
#[cfg(feature = "blocking")] #[cfg(feature = "blocking")]
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
#[cfg(feature = "blocking")] #[cfg(feature = "blocking")]