From a8f9f6c43adb90c9ceced21da6b6bafaa90d7af9 Mon Sep 17 00:00:00 2001 From: rajarshimaitra Date: Tue, 23 Aug 2022 21:44:38 +0530 Subject: [PATCH] RpcBlockchain derefs to the underlying RPC Client --- src/blockchain/rpc.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/blockchain/rpc.rs b/src/blockchain/rpc.rs index 42df6adc..b2c64ba5 100644 --- a/src/blockchain/rpc.rs +++ b/src/blockchain/rpc.rs @@ -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 {