Skip to content

Commit fb2f105

Browse files
Fix test and examples
Remove `FeeRate` from test as that is a BDK trait and update example to reflect new design.
1 parent 04103d3 commit fb2f105

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

src/lib.rs

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
//! Esplora
22
//!
3-
//! This module defines a [`EsploraBlockchain`] struct that can query an Esplora
4-
//! backend populate the wallet's [database](crate::database::Database) by:
3+
//! This module defines a [`Builder`] struct that can create a blocking or
4+
//! async Esplora client to query an Esplora backend:
55
//!
6-
//! ## Example
6+
//! ## Examples
77
//!
88
//! ```no_run
9-
//! # use bdk::blockchain::esplora::EsploraBlockchain;
10-
//! let blockchain = EsploraBlockchain::new("https://blockstream.info/testnet/api", 20);
11-
//! # Ok::<(), bdk::Error>(())
9+
//! # use esplora_client::Builder;
10+
//! let builder = Builder::new("https://blockstream.info/testnet/api");
11+
//! let blocking_client = builder.build_blocking();
12+
//! # Ok::<(), esplora_client::Error>(());
13+
//! ```
14+
//! ```no_run
15+
//! # use esplora_client::Builder;
16+
//! let builder = Builder::new("https://blockstream.info/testnet/api");
17+
//! let async_client = builder.build_async();
18+
//! # Ok::<(), esplora_client::Error>(());
1219
//! ```
1320
//!
14-
//! Esplora blockchain can use either `ureq` or `reqwest` for the HTTP client
21+
//! Esplora client can use either `ureq` or `reqwest` for the HTTP client
1522
//! depending on your needs (blocking or async respectively).
1623
//!
1724
//! Please note, to configure the Esplora HTTP client correctly use one of:
18-
//! Blocking: --features='esplora,ureq'
19-
//! Async: --features='async-interface,esplora,reqwest' --no-default-features
25+
//! Blocking: --features='blocking'
26+
//! Async: --features='async'
2027
use std::collections::HashMap;
2128
use std::fmt;
2229
use std::io;
@@ -200,12 +207,12 @@ mod test {
200207
)
201208
.unwrap();
202209
assert_eq!(
203-
into_fee_rate(6, esplora_fees.clone()).unwrap(),
204-
FeeRate::from_sat_per_vb(2.236)
210+
convert_fee_rate(6, esplora_fees.clone()).unwrap(),
211+
2.236
205212
);
206213
assert_eq!(
207-
into_fee_rate(26, esplora_fees).unwrap(),
208-
FeeRate::from_sat_per_vb(1.015),
214+
convert_fee_rate(26, esplora_fees).unwrap(),
215+
1.015,
209216
"should inherit from value for 25"
210217
);
211218
}

0 commit comments

Comments
 (0)