]> Untitled Git - bdk/commitdiff
fix(bdk_esplora): build with `--no-default-features`
authorLeonardo Lima <oleonardolima@users.noreply.github.com>
Mon, 16 Sep 2024 15:51:29 +0000 (12:51 -0300)
committerLeonardo Lima <oleonardolima@users.noreply.github.com>
Fri, 20 Sep 2024 00:47:37 +0000 (21:47 -0300)
- add `blocking-https` as one of the default features, instead of
  `blocking-https-rustls`, they are basically the same in
  `esplora-client`.
- add `async` and `blocking as required features for each test, using
  the `[[test]]` cargo target.

crates/esplora/Cargo.toml
crates/esplora/README.md

index c13fbb17bf07a6d2c3d1879c0b88a0f2a6e197d7..e7190f4eccca0ece980abd9d8a0a6b9b6879021e 100644 (file)
@@ -27,10 +27,23 @@ bdk_testenv = { path = "../testenv", default-features = false }
 tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros"] }
 
 [features]
-default = ["std", "async-https", "blocking-https-rustls"]
+default = ["std", "async-https", "blocking-https"]
 std = ["bdk_chain/std", "miniscript?/std"]
 async = ["async-trait", "futures", "esplora-client/async"]
 async-https = ["async", "esplora-client/async-https"]
 async-https-rustls = ["async", "esplora-client/async-https-rustls"]
+async-https-native = ["async", "esplora-client/async-https-native"]
 blocking = ["esplora-client/blocking"]
-blocking-https-rustls = ["esplora-client/blocking-https-rustls"]
+blocking-https = ["blocking", "esplora-client/blocking-https"]
+blocking-https-rustls = ["blocking", "esplora-client/blocking-https-rustls"]
+blocking-https-native = ["blocking", "esplora-client/blocking-https-native"]
+
+[[test]]
+name = "blocking"
+path = "tests/blocking_ext.rs"
+required-features = ["blocking"]
+
+[[test]]
+name = "async"
+path = "tests/async_ext.rs"
+required-features = ["async"]
index 0535b9a385c21127d5f00ac1d0ac1f992826c7d7..d06e386cda76a0d4baf667086d1604dc0699e36c 100644 (file)
@@ -26,8 +26,11 @@ bdk_esplora = { version = "0.3", features = ["async-https"] }
 To use the extension traits:
 ```rust
 // for blocking
+#[cfg(feature = "blocking")]
 use bdk_esplora::EsploraExt;
+
 // for async
+#[cfg(feature = "async")]
 use bdk_esplora::EsploraAsyncExt;
 ```