Skip to content

Commit

Permalink
deps: add logic to moksha-wallet dependencies
Browse files Browse the repository at this point in the history
While attempting to compile for esp32 boards using esp-rs crates, moksha-wallet couldn't
be depended on because of various compile errors. When compiling for esp, you are not targeting
wasm. Irconically, the wasm dependencies mostly compiled for esp. This commit adds logic so
espcash can depend directly on moksha to more easily implement an ecash clinet for embedded devices.
  • Loading branch information
EthnTuttle committed Feb 27, 2024
1 parent 7496b81 commit 0ccb60f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions moksha-wallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ thiserror = "1.0.56"
async-trait = "0.1.77"
lightning-invoice = "0.29.0"
url = "2.5.0"
dirs = "5.0.1"

[target.'cfg(target_family = "wasm")'.dependencies]
gloo-net = { version = "0.5.0" }
Expand All @@ -32,11 +31,20 @@ wasm-bindgen = "0.2.90"
rexie = "0.5.0"
tokio = { version = "1.35.1", features = ["rt", "sync"] }

[target.'cfg(not(target_family="wasm"))'.dependencies]
[target.'cfg(all(not(target_family="wasm"), not(target_os="espidf")))'.dependencies]
reqwest = { version = "0.11.23", features = ["serde_json", "json", "rustls-tls"], default-features = false }
tokio = { version = "1.35.1", features = ["rt", "rt-multi-thread", "macros"] }
sqlx = { version = "0.7.3", default-features = false, features = ["sqlite", "runtime-tokio", "tls-rustls", "migrate", "macros"] }

# Any target_family except espidf
[target.'cfg(not(target_os = "espidf"))'.dependencies]
dirs = "5.0.1"

[target.'cfg(target_os="espidf")'.dependencies]
gloo-net = { version = "0.5.0" }
rexie = "0.5.0"
tokio = { version = "1.35.1", features = ["rt", "sync"] }

[dev-dependencies]
tempfile = "3.9.0"
mockall = "0.12.1"

0 comments on commit 0ccb60f

Please sign in to comment.