diff --git a/crates/esplora/src/async_ext.rs b/crates/esplora/src/async_ext.rs index 649cd6891a..f2675b7117 100644 --- a/crates/esplora/src/async_ext.rs +++ b/crates/esplora/src/async_ext.rs @@ -6,11 +6,14 @@ use bdk_chain::{ local_chain::{self, CheckPoint}, BlockId, ConfirmationTimeHeightAnchor, TxGraph, }; -use esplora_client::{Error, TxStatus}; +use esplora_client::TxStatus; use futures::{stream::FuturesOrdered, TryStreamExt}; use crate::{anchor_from_status, ASSUME_FINAL_DEPTH}; +/// [`esplora_client::Error`] +type Error = Box; + /// Trait to extend the functionality of [`esplora_client::AsyncClient`]. /// /// Refer to [crate-level documentation] for more. @@ -29,7 +32,6 @@ pub trait EsploraAsyncExt { /// [`LocalChain`]: bdk_chain::local_chain::LocalChain /// [`LocalChain::tip`]: bdk_chain::local_chain::LocalChain::tip /// [`LocalChain::apply_update`]: bdk_chain::local_chain::LocalChain::apply_update - #[allow(clippy::result_large_err)] async fn update_local_chain( &self, local_tip: CheckPoint, @@ -44,7 +46,6 @@ pub trait EsploraAsyncExt { /// The full scan for each keychain stops after a gap of `stop_gap` script pubkeys with no associated /// transactions. `parallel_requests` specifies the max number of HTTP requests to make in /// parallel. - #[allow(clippy::result_large_err)] async fn full_scan( &self, keychain_spks: BTreeMap< @@ -67,7 +68,6 @@ pub trait EsploraAsyncExt { /// may include scripts that have been used, use [`full_scan`] with the keychain. /// /// [`full_scan`]: EsploraAsyncExt::full_scan - #[allow(clippy::result_large_err)] async fn sync( &self, misc_spks: impl IntoIterator + Send> + Send, diff --git a/crates/esplora/src/blocking_ext.rs b/crates/esplora/src/blocking_ext.rs index 493c4b8a79..460c5263bd 100644 --- a/crates/esplora/src/blocking_ext.rs +++ b/crates/esplora/src/blocking_ext.rs @@ -7,10 +7,13 @@ use bdk_chain::{ local_chain::{self, CheckPoint}, BlockId, ConfirmationTimeHeightAnchor, TxGraph, }; -use esplora_client::{Error, TxStatus}; +use esplora_client::TxStatus; use crate::{anchor_from_status, ASSUME_FINAL_DEPTH}; +/// [`esplora_client::Error`] +type Error = Box; + /// Trait to extend the functionality of [`esplora_client::BlockingClient`]. /// /// Refer to [crate-level documentation] for more. @@ -27,7 +30,6 @@ pub trait EsploraExt { /// [`LocalChain`]: bdk_chain::local_chain::LocalChain /// [`LocalChain::tip`]: bdk_chain::local_chain::LocalChain::tip /// [`LocalChain::apply_update`]: bdk_chain::local_chain::LocalChain::apply_update - #[allow(clippy::result_large_err)] fn update_local_chain( &self, local_tip: CheckPoint, @@ -42,7 +44,6 @@ pub trait EsploraExt { /// The full scan for each keychain stops after a gap of `stop_gap` script pubkeys with no associated /// transactions. `parallel_requests` specifies the max number of HTTP requests to make in /// parallel. - #[allow(clippy::result_large_err)] fn full_scan( &self, keychain_spks: BTreeMap>, @@ -62,7 +63,6 @@ pub trait EsploraExt { /// may include scripts that have been used, use [`full_scan`] with the keychain. /// /// [`full_scan`]: EsploraExt::full_scan - #[allow(clippy::result_large_err)] fn sync( &self, misc_spks: impl IntoIterator, @@ -286,7 +286,12 @@ impl EsploraExt for esplora_client::BlockingClient { .map(|txid| { std::thread::spawn({ let client = self.clone(); - move || client.get_tx_status(&txid).map(|s| (txid, s)) + move || { + client + .get_tx_status(&txid) + .map_err(Box::new) + .map(|s| (txid, s)) + } }) }) .collect::>>>();