Skip to content

Commit

Permalink
fix(bdk_esplora): build with --no-default-features
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
oleonardolima committed Sep 20, 2024
1 parent 88423f3 commit 33942ec
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
17 changes: 15 additions & 2 deletions crates/esplora/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
3 changes: 3 additions & 0 deletions crates/esplora/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
```

Expand Down

0 comments on commit 33942ec

Please sign in to comment.