41
41
//! specific features, set `default-features` to `false` in your `Cargo.toml`
42
42
//! and specify the features you want. This will look like this:
43
43
//!
44
- //! `esplora-client = { version = "*", default-features = false, features = ["blocking"] }`
44
+ //! `esplora-client = { version = "*", default-features = false, features =
45
+ //! ["blocking"] }`
45
46
//!
46
47
//! * `blocking` enables [`minreq`], the blocking client with proxy.
47
- //! * `blocking-https` enables [`minreq`], the blocking client with proxy and TLS (SSL)
48
- //! capabilities using the default [`minreq`] backend.
49
- //! * `blocking-https-rustls` enables [`minreq`], the blocking client with proxy and TLS (SSL)
50
- //! capabilities using the `rustls` backend.
51
- //! * `blocking-https-native` enables [`minreq`], the blocking client with proxy and TLS (SSL)
52
- //! capabilities using the platform's native TLS backend (likely OpenSSL).
53
- //! * `blocking-https-bundled` enables [`minreq`], the blocking client with proxy and TLS (SSL)
54
- //! capabilities using a bundled OpenSSL library backend.
48
+ //! * `blocking-https` enables [`minreq`], the blocking client with proxy and
49
+ //! TLS (SSL) capabilities using the default [`minreq`] backend.
50
+ //! * `blocking-https-rustls` enables [`minreq`], the blocking client with proxy
51
+ //! and TLS (SSL) capabilities using the `rustls` backend.
52
+ //! * `blocking-https-native` enables [`minreq`], the blocking client with proxy
53
+ //! and TLS (SSL) capabilities using the platform's native TLS backend (likely
54
+ //! OpenSSL).
55
+ //! * `blocking-https-bundled` enables [`minreq`], the blocking client with
56
+ //! proxy and TLS (SSL) capabilities using a bundled OpenSSL library backend.
55
57
//! * `async` enables [`reqwest`], the async client with proxy capabilities.
56
- //! * `async-https` enables [`reqwest`], the async client with support for proxying and TLS (SSL)
57
- //! using the default [`reqwest`] TLS backend.
58
- //! * `async-https-native` enables [`reqwest`], the async client with support for proxying and TLS
59
- //! (SSL) using the platform's native TLS backend (likely OpenSSL).
60
- //! * `async-https-rustls` enables [`reqwest`], the async client with support for proxying and TLS
61
- //! (SSL) using the `rustls` TLS backend.
62
- //! * `async-https-rustls-manual-roots` enables [`reqwest`], the async client with support for
63
- //! proxying and TLS (SSL) using the ` rustls` TLS backend without using its the default root
64
- //! certificates.
65
- //!
58
+ //! * `async-https` enables [`reqwest`], the async client with support for
59
+ //! proxying and TLS (SSL) using the default [`reqwest`] TLS backend.
60
+ //! * `async-https-native` enables [`reqwest`], the async client with support
61
+ //! for proxying and TLS (SSL) using the platform's native TLS backend (likely
62
+ //! OpenSSL).
63
+ //! * `async-https-rustls` enables [`reqwest`], the async client with support
64
+ //! for proxying and TLS (SSL) using the `rustls` TLS backend.
65
+ //! * `async-https- rustls-manual-roots` enables [`reqwest`], the async client
66
+ //! with support for proxying and TLS (SSL) using the `rustls` TLS backend
67
+ //! without using its the default root certificates.
66
68
//!
67
69
68
70
#![ allow( clippy:: result_large_err) ]
@@ -89,7 +91,8 @@ pub use r#async::AsyncClient;
89
91
/// Get a fee value in sats/vbytes from the estimates
90
92
/// that matches the confirmation target set as parameter.
91
93
///
92
- /// Returns `None` if no feerate estimate is found at or below `target` confirmations.
94
+ /// Returns `None` if no feerate estimate is found at or below `target`
95
+ /// confirmations.
93
96
pub fn convert_fee_rate ( target : usize , estimates : HashMap < u16 , f64 > ) -> Option < f32 > {
94
97
estimates
95
98
. into_iter ( )
@@ -103,11 +106,13 @@ pub struct Builder {
103
106
pub base_url : String ,
104
107
/// Optional URL of the proxy to use to make requests to the Esplora server
105
108
///
106
- /// The string should be formatted as: `<protocol>://<user>:<password>@host:<port>`.
109
+ /// The string should be formatted as:
110
+ /// `<protocol>://<user>:<password>@host:<port>`.
107
111
///
108
- /// Note that the format of this value and the supported protocols change slightly between the
109
- /// blocking version of the client (using `minreq`) and the async version (using `reqwest`). For more
110
- /// details check with the documentation of the two crates. Both of them are compiled with
112
+ /// Note that the format of this value and the supported protocols change
113
+ /// slightly between the blocking version of the client (using `minreq`)
114
+ /// and the async version (using `reqwest`). For more details check with
115
+ /// the documentation of the two crates. Both of them are compiled with
111
116
/// the `socks` feature enabled.
112
117
///
113
118
/// The proxy is ignored when targeting `wasm32`.
@@ -594,8 +599,8 @@ mod test {
594
599
#[ cfg( all( feature = "blocking" , feature = "async" ) ) ]
595
600
#[ tokio:: test]
596
601
async fn test_get_non_existing_block_status ( ) {
597
- // Esplora returns the same status for orphaned blocks as for non-existing blocks:
598
- // non-existing: https://blockstream.info/api/block/0000000000000000000000000000000000000000000000000000000000000000/status
602
+ // Esplora returns the same status for orphaned blocks as for non-existing
603
+ // blocks: non-existing: https://blockstream.info/api/block/0000000000000000000000000000000000000000000000000000000000000000/status
599
604
// orphaned: https://blockstream.info/api/block/000000000000000000181b1a2354620f66868a723c0c4d5b24e4be8bdfc35a7f/status
600
605
// (Here the block is cited as orphaned: https://bitcoinchain.com/block_explorer/block/000000000000000000181b1a2354620f66868a723c0c4d5b24e4be8bdfc35a7f/ )
601
606
// For this reason, we only test for the non-existing case here.
0 commit comments