Skip to content

Commit 32886a4

Browse files
refactor: rename methods in EsploraExt and EsploraExtAsync
1 parent 3dd481f commit 32886a4

File tree

5 files changed

+12
-17
lines changed

5 files changed

+12
-17
lines changed

crates/esplora/src/async_ext.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub trait EsploraAsyncExt {
4848
/// transactions. `parallel_requests` specifies the max number of HTTP requests to make in
4949
/// parallel.
5050
#[allow(clippy::result_large_err)]
51-
async fn update_tx_graph<K: Ord + Clone + Send>(
51+
async fn scan_txs_with_keychains<K: Ord + Clone + Send>(
5252
&self,
5353
keychain_spks: BTreeMap<
5454
K,
@@ -64,14 +64,14 @@ pub trait EsploraAsyncExt {
6464
///
6565
/// [`update_tx_graph`]: EsploraAsyncExt::update_tx_graph
6666
#[allow(clippy::result_large_err)]
67-
async fn update_tx_graph_without_keychain(
67+
async fn scan_txs(
6868
&self,
6969
misc_spks: impl IntoIterator<IntoIter = impl Iterator<Item = ScriptBuf> + Send> + Send,
7070
txids: impl IntoIterator<IntoIter = impl Iterator<Item = Txid> + Send> + Send,
7171
outpoints: impl IntoIterator<IntoIter = impl Iterator<Item = OutPoint> + Send> + Send,
7272
parallel_requests: usize,
7373
) -> Result<TxGraph<ConfirmationTimeAnchor>, Error> {
74-
self.update_tx_graph(
74+
self.scan_txs_with_keychains(
7575
[(
7676
(),
7777
misc_spks
@@ -201,7 +201,7 @@ impl EsploraAsyncExt for esplora_client::AsyncClient {
201201
})
202202
}
203203

204-
async fn update_tx_graph<K: Ord + Clone + Send>(
204+
async fn scan_txs_with_keychains<K: Ord + Clone + Send>(
205205
&self,
206206
keychain_spks: BTreeMap<
207207
K,

crates/esplora/src/blocking_ext.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub trait EsploraExt {
4646
/// transactions. `parallel_requests` specifies the max number of HTTP requests to make in
4747
/// parallel.
4848
#[allow(clippy::result_large_err)]
49-
fn update_tx_graph<K: Ord + Clone>(
49+
fn scan_txs_with_keychains<K: Ord + Clone>(
5050
&self,
5151
keychain_spks: BTreeMap<K, impl IntoIterator<Item = (u32, ScriptBuf)>>,
5252
txids: impl IntoIterator<Item = Txid>,
@@ -59,14 +59,14 @@ pub trait EsploraExt {
5959
///
6060
/// [`update_tx_graph`]: EsploraExt::update_tx_graph
6161
#[allow(clippy::result_large_err)]
62-
fn update_tx_graph_without_keychain(
62+
fn scan_txs(
6363
&self,
6464
misc_spks: impl IntoIterator<Item = ScriptBuf>,
6565
txids: impl IntoIterator<Item = Txid>,
6666
outpoints: impl IntoIterator<Item = OutPoint>,
6767
parallel_requests: usize,
6868
) -> Result<TxGraph<ConfirmationTimeAnchor>, Error> {
69-
self.update_tx_graph(
69+
self.scan_txs_with_keychains(
7070
[(
7171
(),
7272
misc_spks
@@ -192,7 +192,7 @@ impl EsploraExt for esplora_client::BlockingClient {
192192
})
193193
}
194194

195-
fn update_tx_graph<K: Ord + Clone>(
195+
fn scan_txs_with_keychains<K: Ord + Clone>(
196196
&self,
197197
keychain_spks: BTreeMap<K, impl IntoIterator<Item = (u32, ScriptBuf)>>,
198198
txids: impl IntoIterator<Item = Txid>,

example-crates/example_esplora/src/main.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ fn main() -> anyhow::Result<()> {
156156
// represents the last active spk derivation indices of keychains
157157
// (`keychain_indices_update`).
158158
let (graph_update, keychain_indices_update) = client
159-
.update_tx_graph(
159+
.scan_txs_with_keychains(
160160
keychain_spks,
161161
core::iter::empty(),
162162
core::iter::empty(),
@@ -273,12 +273,7 @@ fn main() -> anyhow::Result<()> {
273273
}
274274
}
275275

276-
client.update_tx_graph_without_keychain(
277-
spks,
278-
txids,
279-
outpoints,
280-
scan_options.parallel_requests,
281-
)?
276+
client.scan_txs(spks, txids, outpoints, scan_options.parallel_requests)?
282277
}
283278
};
284279

example-crates/wallet_esplora/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
5555
.collect();
5656

5757
let (update_graph, last_active_indices) =
58-
client.update_tx_graph(keychain_spks, None, None, STOP_GAP, PARALLEL_REQUESTS)?;
58+
client.scan_txs_with_keychains(keychain_spks, None, None, STOP_GAP, PARALLEL_REQUESTS)?;
5959
let missing_heights = wallet.tx_graph().missing_heights(wallet.local_chain());
6060
let chain_update = client.update_local_chain(prev_tip, missing_heights)?;
6161
let update = LocalUpdate {

example-crates/wallet_esplora_async/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
5555
})
5656
.collect();
5757
let (update_graph, last_active_indices) = client
58-
.update_tx_graph(keychain_spks, None, None, STOP_GAP, PARALLEL_REQUESTS)
58+
.scan_txs_with_keychains(keychain_spks, None, None, STOP_GAP, PARALLEL_REQUESTS)
5959
.await?;
6060
let missing_heights = wallet.tx_graph().missing_heights(wallet.local_chain());
6161
let chain_update = client.update_local_chain(prev_tip, missing_heights).await?;

0 commit comments

Comments
 (0)