Implement Deref<Target=Client> for ElectrumBlockchain

As pointed out in https://github.com/bitcoindevkit/rust-electrum-client/pull/58#issuecomment-1207890096
there was no way to keep using the client once it was given to BDK.
This commit is contained in:
Alekos Filini 2022-08-08 12:03:35 +02:00
parent 03d3c786f2
commit c5952dd09a
No known key found for this signature in database
GPG Key ID: 431401E4A4530061

View File

@ -25,6 +25,7 @@
//! ```
use std::collections::{HashMap, HashSet};
use std::ops::Deref;
#[allow(unused_imports)]
use log::{debug, error, info, trace};
@ -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 {