Skip to content

Commit f099b42

Browse files
committed
Merge #1306: Implement ElectrumExt for all that implements ElectrumApi
ce8c617 feat(electrum): impl `ElectrumExt` for all that impl `ElectrumApi` (志宇) Pull request description: ### Description Implement `ElectrumExt` for all that implements `ElectrumApi`. I realized this while looking into #1171. https://github.com/bitcoindevkit/bdk/blob/2196685cca741a249f4a5b53c7609162469714ba/crates/electrum/tests/test_electrum.rs#L54-L55 Line 55 here should not be necessary. ### Changelog notice * Changed to implement `ElectrumExt` for all that implements `ElectrumApi`. ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing ACKs for top commit: notmandatory: ACK ce8c617 Tree-SHA512: d95193a9a356a0aa3f467db3b8c7bf2cfdf83afd520f5254721912cfe82355de1198256b90323e51ffdb0bf955ff923a9ceb8b4541d4a5ad2331ff0bf26ab937
2 parents 8ad52f7 + ce8c617 commit f099b42

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

crates/electrum/src/electrum_ext.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ pub trait ElectrumExt {
179179
) -> Result<ElectrumUpdate, Error>;
180180
}
181181

182-
impl ElectrumExt for Client {
182+
impl<A: ElectrumApi> ElectrumExt for A {
183183
fn full_scan<K: Ord + Clone>(
184184
&self,
185185
prev_tip: CheckPoint,
@@ -303,7 +303,7 @@ impl ElectrumExt for Client {
303303

304304
/// Return a [`CheckPoint`] of the latest tip, that connects with `prev_tip`.
305305
fn construct_update_tip(
306-
client: &Client,
306+
client: &impl ElectrumApi,
307307
prev_tip: CheckPoint,
308308
) -> Result<(CheckPoint, Option<u32>), Error> {
309309
let HeaderNotification { height, .. } = client.block_headers_subscribe()?;
@@ -417,7 +417,7 @@ fn determine_tx_anchor(
417417
}
418418

419419
fn populate_with_outpoints(
420-
client: &Client,
420+
client: &impl ElectrumApi,
421421
cps: &BTreeMap<u32, CheckPoint>,
422422
relevant_txids: &mut RelevantTxids,
423423
outpoints: impl IntoIterator<Item = OutPoint>,
@@ -478,7 +478,7 @@ fn populate_with_outpoints(
478478
}
479479

480480
fn populate_with_txids(
481-
client: &Client,
481+
client: &impl ElectrumApi,
482482
cps: &BTreeMap<u32, CheckPoint>,
483483
relevant_txids: &mut RelevantTxids,
484484
txids: impl IntoIterator<Item = Txid>,
@@ -514,7 +514,7 @@ fn populate_with_txids(
514514
}
515515

516516
fn populate_with_spks<I: Ord + Clone>(
517-
client: &Client,
517+
client: &impl ElectrumApi,
518518
cps: &BTreeMap<u32, CheckPoint>,
519519
relevant_txids: &mut RelevantTxids,
520520
spks: &mut impl Iterator<Item = (I, ScriptBuf)>,

0 commit comments

Comments
 (0)