mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 15:11:03 +00:00
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:
@@ -74,7 +74,7 @@ impl<T: Config> OnlineClient<T> {
|
||||
let client = jsonrpsee_helpers::ws_client(url.as_ref())
|
||||
.await
|
||||
.map_err(|e| crate::error::RpcError(e.to_string()))?;
|
||||
OnlineClient::from_rpc_client(client).await
|
||||
OnlineClient::from_rpc_client(Arc::new(client)).await
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ impl<T: Config> OnlineClient<T> {
|
||||
/// Construct a new [`OnlineClient`] by providing an underlying [`RpcClientT`]
|
||||
/// implementation to drive the connection.
|
||||
pub async fn from_rpc_client<R: RpcClientT>(
|
||||
rpc_client: R,
|
||||
rpc_client: Arc<R>,
|
||||
) -> Result<OnlineClient<T>, Error> {
|
||||
let rpc = Rpc::new(rpc_client);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user