X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=lightning-block-sync%2Fsrc%2Frpc.rs;h=cc3bc4525a1289fbe0d87344b4c865458182f480;hb=836985a5e5e8036d5dea47797ef6fba498616e67;hp=34cbd2e02c028eb51a364f431f509cabdee4c4c0;hpb=6dcb7c4d05914bdd324a82e1e72b355de0fac530;p=rust-lightning diff --git a/lightning-block-sync/src/rpc.rs b/lightning-block-sync/src/rpc.rs index 34cbd2e0..cc3bc452 100644 --- a/lightning-block-sync/src/rpc.rs +++ b/lightning-block-sync/src/rpc.rs @@ -1,3 +1,6 @@ +//! Simple RPC client implementation which implements [`BlockSource`] against a Bitcoin Core RPC +//! endpoint. + use crate::{BlockHeaderData, BlockSource, AsyncBlockSourceResult}; use crate::http::{HttpClient, HttpEndpoint, JsonResponse}; @@ -34,7 +37,7 @@ impl RpcClient { } /// Calls a method with the response encoded in JSON format and interpreted as type `T`. - async fn call_method(&mut self, method: &str, params: &[serde_json::Value]) -> std::io::Result + pub async fn call_method(&mut self, method: &str, params: &[serde_json::Value]) -> std::io::Result where JsonResponse: TryFrom, Error = std::io::Error> + TryInto { let host = format!("{}:{}", self.endpoint.host(), self.endpoint.port()); let uri = self.endpoint.path();