diff --git a/crates/esplora/src/async_ext.rs b/crates/esplora/src/async_ext.rs index 389022f0c..c6e2b05c4 100644 --- a/crates/esplora/src/async_ext.rs +++ b/crates/esplora/src/async_ext.rs @@ -48,7 +48,7 @@ pub trait EsploraAsyncExt { /// transactions. `parallel_requests` specifies the max number of HTTP requests to make in /// parallel. #[allow(clippy::result_large_err)] - async fn update_tx_graph( + async fn scan_txs_with_keychains( &self, keychain_spks: BTreeMap< K, @@ -60,18 +60,18 @@ pub trait EsploraAsyncExt { parallel_requests: usize, ) -> Result<(TxGraph, BTreeMap), Error>; - /// Convenience method to call [`update_tx_graph`] without requiring a keychain. + /// Convenience method to call [`scan_txs_with_keychains`] without requiring a keychain. /// - /// [`update_tx_graph`]: EsploraAsyncExt::update_tx_graph + /// [`scan_txs_with_keychains`]: EsploraAsyncExt::scan_txs_with_keychains #[allow(clippy::result_large_err)] - async fn update_tx_graph_without_keychain( + async fn scan_txs( &self, misc_spks: impl IntoIterator + Send> + Send, txids: impl IntoIterator + Send> + Send, outpoints: impl IntoIterator + Send> + Send, parallel_requests: usize, ) -> Result, Error> { - self.update_tx_graph( + self.scan_txs_with_keychains( [( (), misc_spks @@ -201,7 +201,7 @@ impl EsploraAsyncExt for esplora_client::AsyncClient { }) } - async fn update_tx_graph( + async fn scan_txs_with_keychains( &self, keychain_spks: BTreeMap< K, diff --git a/crates/esplora/src/blocking_ext.rs b/crates/esplora/src/blocking_ext.rs index 6d42fe015..218e9c7f9 100644 --- a/crates/esplora/src/blocking_ext.rs +++ b/crates/esplora/src/blocking_ext.rs @@ -46,7 +46,7 @@ pub trait EsploraExt { /// transactions. `parallel_requests` specifies the max number of HTTP requests to make in /// parallel. #[allow(clippy::result_large_err)] - fn update_tx_graph( + fn scan_txs_with_keychains( &self, keychain_spks: BTreeMap>, txids: impl IntoIterator, @@ -55,18 +55,18 @@ pub trait EsploraExt { parallel_requests: usize, ) -> Result<(TxGraph, BTreeMap), Error>; - /// Convenience method to call [`update_tx_graph`] without requiring a keychain. + /// Convenience method to call [`scan_txs_with_keychains`] without requiring a keychain. /// - /// [`update_tx_graph`]: EsploraExt::update_tx_graph + /// [`scan_txs_with_keychains`]: EsploraExt::scan_txs_with_keychains #[allow(clippy::result_large_err)] - fn update_tx_graph_without_keychain( + fn scan_txs( &self, misc_spks: impl IntoIterator, txids: impl IntoIterator, outpoints: impl IntoIterator, parallel_requests: usize, ) -> Result, Error> { - self.update_tx_graph( + self.scan_txs_with_keychains( [( (), misc_spks @@ -192,7 +192,7 @@ impl EsploraExt for esplora_client::BlockingClient { }) } - fn update_tx_graph( + fn scan_txs_with_keychains( &self, keychain_spks: BTreeMap>, txids: impl IntoIterator, diff --git a/example-crates/example_esplora/src/main.rs b/example-crates/example_esplora/src/main.rs index f33125be8..1aff0db25 100644 --- a/example-crates/example_esplora/src/main.rs +++ b/example-crates/example_esplora/src/main.rs @@ -154,7 +154,7 @@ fn main() -> anyhow::Result<()> { // represents the last active spk derivation indices of keychains // (`keychain_indices_update`). let (graph_update, last_active_indices) = client - .update_tx_graph( + .scan_txs_with_keychains( keychain_spks, core::iter::empty(), core::iter::empty(), @@ -276,12 +276,8 @@ fn main() -> anyhow::Result<()> { } } - let graph_update = client.update_tx_graph_without_keychain( - spks, - txids, - outpoints, - scan_options.parallel_requests, - )?; + let graph_update = + client.scan_txs(spks, txids, outpoints, scan_options.parallel_requests)?; graph.lock().unwrap().apply_update(graph_update) } diff --git a/example-crates/wallet_esplora_async/src/main.rs b/example-crates/wallet_esplora_async/src/main.rs index 343a09763..b5c171636 100644 --- a/example-crates/wallet_esplora_async/src/main.rs +++ b/example-crates/wallet_esplora_async/src/main.rs @@ -55,7 +55,7 @@ async fn main() -> Result<(), Box> { }) .collect(); let (update_graph, last_active_indices) = client - .update_tx_graph(keychain_spks, None, None, STOP_GAP, PARALLEL_REQUESTS) + .scan_txs_with_keychains(keychain_spks, None, None, STOP_GAP, PARALLEL_REQUESTS) .await?; let missing_heights = wallet.tx_graph().missing_heights(wallet.local_chain()); let chain_update = client.update_local_chain(prev_tip, missing_heights).await?; diff --git a/example-crates/wallet_esplora_blocking/src/main.rs b/example-crates/wallet_esplora_blocking/src/main.rs index d108742a5..4001858de 100644 --- a/example-crates/wallet_esplora_blocking/src/main.rs +++ b/example-crates/wallet_esplora_blocking/src/main.rs @@ -55,7 +55,7 @@ fn main() -> Result<(), Box> { .collect(); let (update_graph, last_active_indices) = - client.update_tx_graph(keychain_spks, None, None, STOP_GAP, PARALLEL_REQUESTS)?; + client.scan_txs_with_keychains(keychain_spks, None, None, STOP_GAP, PARALLEL_REQUESTS)?; let missing_heights = wallet.tx_graph().missing_heights(wallet.local_chain()); let chain_update = client.update_local_chain(prev_tip, missing_heights)?; let update = WalletUpdate {