Skip to content

Commit

Permalink
Merge #731: Implement Deref<Target=Client> for RpcBlockchain
Browse files Browse the repository at this point in the history
a8f9f6c RpcBlockchain derefs to the underlying RPC Client (rajarshimaitra)

Pull request description:

  <!-- You can erase any parts of this template not applicable to your Pull Request. -->

  ### Description

  For the same reason as #705  and #722 ..

  ### 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:
  afilini:
    ACK a8f9f6c

Tree-SHA512: 81e596fe451c275ca0ce27ee7ac9cf7e88433775603021c2dd1cd26a26558531cf74f81ef05d0ae9d5d0e59e91196e3ac6d38c0f4853b1889ddf822d8e63e178
  • Loading branch information
afilini committed Aug 25, 2022
2 parents c9b1b6d + a8f9f6c commit 34e792e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/blockchain/rpc.rs
Expand Up @@ -50,6 +50,7 @@ use bitcoincore_rpc::{Client, RpcApi};
use log::{debug, info};
use serde::{Deserialize, Serialize};
use std::collections::{HashMap, HashSet};
use std::ops::Deref;
use std::path::PathBuf;
use std::thread;
use std::time::Duration;
Expand All @@ -67,6 +68,14 @@ pub struct RpcBlockchain {
sync_params: RpcSyncParams,
}

impl Deref for RpcBlockchain {
type Target = Client;

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

/// RpcBlockchain configuration options
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub struct RpcConfig {
Expand Down

0 comments on commit 34e792e

Please sign in to comment.