Skip to content

Commit

Permalink
Implement Deref<Target=Client> for ElectrumBlockchain
Browse files Browse the repository at this point in the history
As pointed out in bitcoindevkit/rust-electrum-client#58 (comment)
there was no way to keep using the client once it was given to BDK.
  • Loading branch information
afilini committed Aug 8, 2022
1 parent 03d3c78 commit c5952dd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/blockchain/electrum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
//! ```

use std::collections::{HashMap, HashSet};
use std::ops::Deref;

#[allow(unused_imports)]
use log::{debug, error, info, trace};
Expand Down Expand Up @@ -79,6 +80,14 @@ impl Blockchain for ElectrumBlockchain {
}
}

impl Deref for ElectrumBlockchain {
type Target = Client;

fn deref(&self) -> &Self::Target {
&self.client
}
}

impl StatelessBlockchain for ElectrumBlockchain {}

impl GetHeight for ElectrumBlockchain {
Expand Down

0 comments on commit c5952dd

Please sign in to comment.