@@ -7,10 +7,13 @@ use bdk_chain::{
7
7
local_chain:: { self , CheckPoint } ,
8
8
BlockId , ConfirmationTimeHeightAnchor , TxGraph ,
9
9
} ;
10
- use esplora_client:: { Error , TxStatus } ;
10
+ use esplora_client:: TxStatus ;
11
11
12
12
use crate :: { anchor_from_status, ASSUME_FINAL_DEPTH } ;
13
13
14
+ /// [`esplora_client::Error`]
15
+ type Error = Box < esplora_client:: Error > ;
16
+
14
17
/// Trait to extend the functionality of [`esplora_client::BlockingClient`].
15
18
///
16
19
/// Refer to [crate-level documentation] for more.
@@ -27,7 +30,6 @@ pub trait EsploraExt {
27
30
/// [`LocalChain`]: bdk_chain::local_chain::LocalChain
28
31
/// [`LocalChain::tip`]: bdk_chain::local_chain::LocalChain::tip
29
32
/// [`LocalChain::apply_update`]: bdk_chain::local_chain::LocalChain::apply_update
30
- #[ allow( clippy:: result_large_err) ]
31
33
fn update_local_chain (
32
34
& self ,
33
35
local_tip : CheckPoint ,
@@ -42,7 +44,6 @@ pub trait EsploraExt {
42
44
/// The full scan for each keychain stops after a gap of `stop_gap` script pubkeys with no associated
43
45
/// transactions. `parallel_requests` specifies the max number of HTTP requests to make in
44
46
/// parallel.
45
- #[ allow( clippy:: result_large_err) ]
46
47
fn full_scan < K : Ord + Clone > (
47
48
& self ,
48
49
keychain_spks : BTreeMap < K , impl IntoIterator < Item = ( u32 , ScriptBuf ) > > ,
@@ -62,7 +63,6 @@ pub trait EsploraExt {
62
63
/// may include scripts that have been used, use [`full_scan`] with the keychain.
63
64
///
64
65
/// [`full_scan`]: EsploraExt::full_scan
65
- #[ allow( clippy:: result_large_err) ]
66
66
fn sync (
67
67
& self ,
68
68
misc_spks : impl IntoIterator < Item = ScriptBuf > ,
@@ -286,7 +286,12 @@ impl EsploraExt for esplora_client::BlockingClient {
286
286
. map ( |txid| {
287
287
std:: thread:: spawn ( {
288
288
let client = self . clone ( ) ;
289
- move || client. get_tx_status ( & txid) . map ( |s| ( txid, s) )
289
+ move || {
290
+ client
291
+ . get_tx_status ( & txid)
292
+ . map_err ( Box :: new)
293
+ . map ( |s| ( txid, s) )
294
+ }
290
295
} )
291
296
} )
292
297
. collect :: < Vec < JoinHandle < Result < ( Txid , TxStatus ) , Error > > > > ( ) ;
0 commit comments