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:
parent
03d3c786f2
commit
c5952dd09a
@ -25,6 +25,7 @@
|
|||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
|
use std::ops::Deref;
|
||||||
|
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
use log::{debug, error, info, trace};
|
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 StatelessBlockchain for ElectrumBlockchain {}
|
||||||
|
|
||||||
impl GetHeight for ElectrumBlockchain {
|
impl GetHeight for ElectrumBlockchain {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user