mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 00:31:07 +00:00
Expose the rpc client in Client (#267)
When we build a `Client` for a substrate chain, we can only access the methods exposed in `Client` which does not cover all the RPC interfaces in the chain, it's not feasible to request the methods like `chain_getKeys` with `Client` only. The downstream user of this library has to build another `RpcClient` for the uncovered RPC interfaces, which can be unneccessary.
This commit is contained in:
@@ -353,6 +353,11 @@ impl<T: Runtime> Client<T> {
|
|||||||
&self.properties
|
&self.properties
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the rpc client.
|
||||||
|
pub fn rpc_client(&self) -> &RpcClient {
|
||||||
|
&self.rpc.client
|
||||||
|
}
|
||||||
|
|
||||||
/// Fetch the value under an unhashed storage key
|
/// Fetch the value under an unhashed storage key
|
||||||
pub async fn fetch_unhashed<V: Decode>(
|
pub async fn fetch_unhashed<V: Decode>(
|
||||||
&self,
|
&self,
|
||||||
|
|||||||
+2
-1
@@ -258,7 +258,8 @@ pub struct ReadProof<Hash> {
|
|||||||
|
|
||||||
/// Client for substrate rpc interfaces
|
/// Client for substrate rpc interfaces
|
||||||
pub struct Rpc<T: Runtime> {
|
pub struct Rpc<T: Runtime> {
|
||||||
client: RpcClient,
|
/// Rpc client for sending requests.
|
||||||
|
pub client: RpcClient,
|
||||||
marker: PhantomData<T>,
|
marker: PhantomData<T>,
|
||||||
accept_weak_inclusion: bool,
|
accept_weak_inclusion: bool,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user