Skip to content

Commit

Permalink
Rename esplora features to -async and -blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
afilini committed Sep 28, 2022
1 parent cf2bc38 commit b5b9224
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/cont_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ jobs:
- default
- minimal
- all-keys
- minimal,use-esplora-ureq
- minimal,use-esplora-blocking
- key-value-db
- electrum
- compact_filters
- esplora,ureq,key-value-db,electrum
- use-esplora-blocking,key-value-db,electrum
- compiler
- rpc
- verify
- async-interface
- use-esplora-reqwest
- use-esplora-async
- sqlite
- sqlite-bundled
steps:
Expand Down Expand Up @@ -100,10 +100,10 @@ jobs:
features: test-rpc-legacy
- name: esplora
testprefix: esplora
features: test-esplora,use-esplora-reqwest,verify
features: test-esplora,use-esplora-async,verify
- name: esplora
testprefix: esplora
features: test-esplora,use-esplora-ureq,verify
features: test-esplora,use-esplora-blocking,verify
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
- name: Update toolchain
run: rustup update
- name: Check
run: cargo check --target wasm32-unknown-unknown --features use-esplora-reqwest --no-default-features
run: cargo check --target wasm32-unknown-unknown --features use-esplora-async --no-default-features

fmt:
name: Rust fmt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Update toolchain
run: rustup update
- name: Build docs
run: cargo rustdoc --verbose --features=compiler,electrum,esplora,ureq,compact_filters,key-value-db,all-keys,sqlite -- --cfg docsrs -Dwarnings
run: cargo rustdoc --verbose --features=compiler,electrum,esplora,use-esplora-blocking,compact_filters,rpc,key-value-db,sqlite,all-keys,verify,hardware-signer -- --cfg docsrs -Dwarnings
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
Expand Down
15 changes: 9 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,25 @@ hardware-signer = ["hwi"]
#
# - Users wanting asynchronous HTTP calls should enable `async-interface` to get
# access to the asynchronous method implementations. Then, if Esplora is wanted,
# enable `esplora` AND `reqwest` (`--features=use-esplora-reqwest`).
# enable the `use-esplora-async` feature.
# - Users wanting blocking HTTP calls can use any of the other blockchain
# implementations (`compact_filters`, `electrum`, or `esplora`). Users wanting to
# use Esplora should enable `esplora` AND `ureq` (`--features=use-esplora-ureq`).
# use Esplora should enable the `use-esplora-blocking` feature.
#
# WARNING: Please take care with the features below, various combinations will
# fail to build. We cannot currently build `bdk` with `--all-features`.
async-interface = ["async-trait"]
electrum = ["electrum-client"]
# MUST ALSO USE `--no-default-features`.
use-esplora-reqwest = ["esplora", "esplora-client/async", "futures"]
use-esplora-ureq = ["esplora", "esplora-client/blocking"]
use-esplora-async = ["esplora", "esplora-client/async", "futures"]
use-esplora-blocking = ["esplora", "esplora-client/blocking"]
# Deprecated aliases
use-esplora-reqwest = ["use-esplora-async"]
use-esplora-ureq = ["use-esplora-blocking"]
# Typical configurations will not need to use `esplora` feature directly.
esplora = []

# Use below feature with `use-esplora-reqwest` to enable reqwest default TLS support
# Use below feature with `use-esplora-async` to enable reqwest default TLS support
reqwest-default-tls = ["esplora-client/async-https"]

# Debug/Test features
Expand Down Expand Up @@ -128,6 +131,6 @@ required-features = ["electrum"]
[workspace]
members = ["macros"]
[package.metadata.docs.rs]
features = ["compiler", "electrum", "esplora", "use-esplora-ureq", "compact_filters", "rpc", "key-value-db", "sqlite", "all-keys", "verify", "hardware-signer"]
features = ["compiler", "electrum", "esplora", "use-esplora-blocking", "compact_filters", "rpc", "key-value-db", "sqlite", "all-keys", "verify", "hardware-signer"]
# defines the configuration attribute `docsrs`
rustdoc-args = ["--cfg", "docsrs"]
8 changes: 4 additions & 4 deletions src/blockchain/esplora/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
pub use esplora_client::Error as EsploraError;

#[cfg(feature = "use-esplora-reqwest")]
#[cfg(feature = "use-esplora-async")]
mod reqwest;

#[cfg(feature = "use-esplora-reqwest")]
#[cfg(feature = "use-esplora-async")]
pub use self::reqwest::*;

#[cfg(feature = "use-esplora-ureq")]
#[cfg(feature = "use-esplora-blocking")]
mod ureq;

#[cfg(feature = "use-esplora-ureq")]
#[cfg(feature = "use-esplora-blocking")]
pub use self::ureq::*;

/// Configuration for an [`EsploraBlockchain`]
Expand Down

0 comments on commit b5b9224

Please sign in to comment.