mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +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:
@@ -76,7 +76,10 @@ use sp_runtime::{
|
||||
},
|
||||
ApplyExtrinsicResult,
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
sync::Arc,
|
||||
};
|
||||
|
||||
/// A number type that can be serialized both as a number or a string that encodes a number in a
|
||||
/// string.
|
||||
@@ -342,7 +345,7 @@ impl<T: Config> std::ops::Deref for Rpc<T> {
|
||||
|
||||
impl<T: Config> Rpc<T> {
|
||||
/// Create a new [`Rpc`]
|
||||
pub fn new<R: RpcClientT>(client: R) -> Self {
|
||||
pub fn new<R: RpcClientT>(client: Arc<R>) -> Self {
|
||||
Self {
|
||||
client: RpcClient::new(client),
|
||||
_marker: PhantomDataSendSync::new(),
|
||||
|
||||
@@ -31,8 +31,8 @@ use std::{
|
||||
pub struct RpcClient(Arc<dyn RpcClientT>);
|
||||
|
||||
impl RpcClient {
|
||||
pub(crate) fn new<R: RpcClientT>(client: R) -> Self {
|
||||
RpcClient(Arc::new(client))
|
||||
pub(crate) fn new<R: RpcClientT>(client: Arc<R>) -> Self {
|
||||
RpcClient(client)
|
||||
}
|
||||
|
||||
/// Make an RPC request, given a method name and some parameters.
|
||||
|
||||
Reference in New Issue
Block a user