From b5b92248c76aeb42ac747931efd45bc2e7af5ebd Mon Sep 17 00:00:00 2001 From: Alekos Filini Date: Wed, 28 Sep 2022 19:33:22 +0200 Subject: [PATCH] Rename esplora features to -async and -blocking --- .github/workflows/cont_integration.yml | 12 ++++++------ .github/workflows/nightly_docs.yml | 2 +- Cargo.toml | 15 +++++++++------ src/blockchain/esplora/mod.rs | 8 ++++---- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index af7e256f3..3b0839023 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -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: @@ -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 @@ -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 diff --git a/.github/workflows/nightly_docs.yml b/.github/workflows/nightly_docs.yml index a82beb2de..190006eae 100644 --- a/.github/workflows/nightly_docs.yml +++ b/.github/workflows/nightly_docs.yml @@ -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: diff --git a/Cargo.toml b/Cargo.toml index 81cfeb4c2..cac6c17eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 @@ -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"] diff --git a/src/blockchain/esplora/mod.rs b/src/blockchain/esplora/mod.rs index edc00926c..7a4b19372 100644 --- a/src/blockchain/esplora/mod.rs +++ b/src/blockchain/esplora/mod.rs @@ -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`]