]> Untitled Git - bdk/commitdiff
RpcBlockchain derefs to the underlying RPC Client
authorrajarshimaitra <rajarshi149@gmail.com>
Tue, 23 Aug 2022 16:14:38 +0000 (21:44 +0530)
committerrajarshimaitra <rajarshi149@gmail.com>
Tue, 23 Aug 2022 16:14:38 +0000 (21:44 +0530)
src/blockchain/rpc.rs

index 42df6adc3bd6d36bb83d4ea2638a339b034dfcaa..b2c64ba5ad4210d423fea3449f12586046bb7d53 100644 (file)
@@ -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;
@@ -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 {