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
- //!
66
- //!
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.
67
68
68
69
#![ allow( clippy:: result_large_err) ]
69
70
@@ -89,7 +90,8 @@ pub use r#async::AsyncClient;
89
90
/// Get a fee value in sats/vbytes from the estimates
90
91
/// that matches the confirmation target set as parameter.
91
92
///
92
- /// Returns `None` if no feerate estimate is found at or below `target` confirmations.
93
+ /// Returns `None` if no feerate estimate is found at or below `target`
94
+ /// confirmations.
93
95
pub fn convert_fee_rate ( target : usize , estimates : HashMap < u16 , f64 > ) -> Option < f32 > {
94
96
estimates
95
97
. into_iter ( )
@@ -103,11 +105,13 @@ pub struct Builder {
103
105
pub base_url : String ,
104
106
/// Optional URL of the proxy to use to make requests to the Esplora server
105
107
///
106
- /// The string should be formatted as: `<protocol>://<user>:<password>@host:<port>`.
108
+ /// The string should be formatted as:
109
+ /// `<protocol>://<user>:<password>@host:<port>`.
107
110
///
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
111
+ /// Note that the format of this value and the supported protocols change
112
+ /// slightly between the blocking version of the client (using `minreq`)
113
+ /// and the async version (using `reqwest`). For more details check with
114
+ /// the documentation of the two crates. Both of them are compiled with
111
115
/// the `socks` feature enabled.
112
116
///
113
117
/// The proxy is ignored when targeting `wasm32`.
@@ -594,8 +598,8 @@ mod test {
594
598
#[ cfg( all( feature = "blocking" , feature = "async" ) ) ]
595
599
#[ tokio:: test]
596
600
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
601
+ // Esplora returns the same status for orphaned blocks as for non-existing
602
+ // blocks: non-existing: https://blockstream.info/api/block/0000000000000000000000000000000000000000000000000000000000000000/status
599
603
// orphaned: https://blockstream.info/api/block/000000000000000000181b1a2354620f66868a723c0c4d5b24e4be8bdfc35a7f/status
600
604
// (Here the block is cited as orphaned: https://bitcoinchain.com/block_explorer/block/000000000000000000181b1a2354620f66868a723c0c4d5b24e4be8bdfc35a7f/ )
601
605
// For this reason, we only test for the non-existing case here.
0 commit comments