Skip to content

Commit

Permalink
feat(electrum): impl ElectrumExt for all that impl ElectrumApi
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlinjin committed Jan 31, 2024
1 parent 8ad52f7 commit ce8c617
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/electrum/src/electrum_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ pub trait ElectrumExt {
) -> Result<ElectrumUpdate, Error>;
}

impl ElectrumExt for Client {
impl<A: ElectrumApi> ElectrumExt for A {
fn full_scan<K: Ord + Clone>(
&self,
prev_tip: CheckPoint,
Expand Down Expand Up @@ -303,7 +303,7 @@ impl ElectrumExt for Client {

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

fn populate_with_outpoints(
client: &Client,
client: &impl ElectrumApi,
cps: &BTreeMap<u32, CheckPoint>,
relevant_txids: &mut RelevantTxids,
outpoints: impl IntoIterator<Item = OutPoint>,
Expand Down Expand Up @@ -478,7 +478,7 @@ fn populate_with_outpoints(
}

fn populate_with_txids(
client: &Client,
client: &impl ElectrumApi,
cps: &BTreeMap<u32, CheckPoint>,
relevant_txids: &mut RelevantTxids,
txids: impl IntoIterator<Item = Txid>,
Expand Down Expand Up @@ -514,7 +514,7 @@ fn populate_with_txids(
}

fn populate_with_spks<I: Ord + Clone>(
client: &Client,
client: &impl ElectrumApi,
cps: &BTreeMap<u32, CheckPoint>,
relevant_txids: &mut RelevantTxids,
spks: &mut impl Iterator<Item = (I, ScriptBuf)>,
Expand Down

0 comments on commit ce8c617

Please sign in to comment.