Merge pull request #889 from evanlinjin/add-async-syncing-esplora

Add docs for `EsploraAsyncExt` and make doctests runnable
This commit is contained in:
志宇 2023-03-17 17:20:08 +08:00 committed by GitHub
commit 2ae69ca10b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 7 deletions

View File

@ -64,7 +64,7 @@ To persist the `Wallet` on disk, `Wallet` needs to be constructed with a
**Example** **Example**
```rust,no_run ```rust
use bdk::{bitcoin::Network, wallet::{AddressIndex, Wallet}}; use bdk::{bitcoin::Network, wallet::{AddressIndex, Wallet}};
fn main() { fn main() {

View File

@ -22,15 +22,12 @@ For async-only (with https):
bdk_esplora = { version = "0.1", features = ["async-https"] } bdk_esplora = { version = "0.1", features = ["async-https"] }
``` ```
To use the extension trait: To use the extension traits:
```rust
```rust,no_run
// for blocking // for blocking
use bdk_esplora::EsploraExt; use bdk_esplora::EsploraExt;
// for async // for async
use bdk_esplora::EsploraAsyncExt; use bdk_esplora::EsploraAsyncExt;
``` ```
<!-- BDK Esplora client library for updating the `bdk_chain` structures. --> For full examples, refer to [`example-crates/wallet_esplora`](https://github.com/bitcoindevkit/bdk/tree/master/example-crates/wallet_esplora) (blocking) and [`example-crates/wallet_esplora_async`](https://github.com/bitcoindevkit/bdk/tree/master/example-crates/wallet_esplora_async).
<!-- [`esplora_client`]: https://docs.rs/esplora-client/latest -->

View File

@ -12,6 +12,13 @@ use futures::stream::{FuturesOrdered, TryStreamExt};
use crate::map_confirmation_time; use crate::map_confirmation_time;
/// Trait to extend [`esplora_client::AsyncClient`] functionality.
///
/// This is the async version of [`EsploraExt`]. Refer to
/// [crate-level documentation] for more.
///
/// [`EsploraExt`]: crate::EsploraExt
/// [crate-level documentation]: crate
#[cfg(feature = "async")] #[cfg(feature = "async")]
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))] #[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait)] #[cfg_attr(not(target_arch = "wasm32"), async_trait)]