expose jsonrpc-core client (#672)

* expose jsonrpc-core client

* use shared reference to RpcClienT

* don't expose Arc<dyn RpcClientT>

* cargo fmt
This commit is contained in:
Web3 Philosopher
2022-10-04 09:56:51 +01:00
committed by GitHub
parent 6cfd3bb511
commit 81175b2dd9
5 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Pass this into our OnlineClient to instantiate it. This will lead to some
// RPC calls being made to fetch chain details/metadata, which will immediately
// fail..
let _ = OnlineClient::<PolkadotConfig>::from_rpc_client(rpc_client).await;
let _ = OnlineClient::<PolkadotConfig>::from_rpc_client(Arc::new(rpc_client)).await;
// But, we can see that the calls were made via our custom RPC client:
println!("Log of calls made:\n\n{}", log.lock().unwrap().as_str());