mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 11:28:02 +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
|
||||
}
|
||||
|
||||
/// Returns the rpc client.
|
||||
pub fn rpc_client(&self) -> &RpcClient {
|
||||
&self.rpc.client
|
||||
}
|
||||
|
||||
/// Fetch the value under an unhashed storage key
|
||||
pub async fn fetch_unhashed<V: Decode>(
|
||||
&self,
|
||||
|
||||
+2
-1
@@ -258,7 +258,8 @@ pub struct ReadProof<Hash> {
|
||||
|
||||
/// Client for substrate rpc interfaces
|
||||
pub struct Rpc<T: Runtime> {
|
||||
client: RpcClient,
|
||||
/// Rpc client for sending requests.
|
||||
pub client: RpcClient,
|
||||
marker: PhantomData<T>,
|
||||
accept_weak_inclusion: bool,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user