From b648bb10593330d59082ca48b710e42369e69996 Mon Sep 17 00:00:00 2001 From: chenkaihong Date: Wed, 10 Aug 2022 16:18:58 +0800 Subject: [PATCH] [api] add state node getter for rpc-client --- rpc/client/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rpc/client/src/lib.rs b/rpc/client/src/lib.rs index f1c8865eaf..599e0fa12c 100644 --- a/rpc/client/src/lib.rs +++ b/rpc/client/src/lib.rs @@ -638,6 +638,14 @@ impl RpcClient { .map_err(map_err) } + pub fn get_state_node_by_node_hash( + &self, + key_hash: HashValue, + ) -> anyhow::Result>> { + self.call_rpc_blocking(|inner| inner.state_client.get_state_node_by_node_hash(key_hash)) + .map_err(map_err) + } + pub fn contract_call(&self, call: ContractCall) -> anyhow::Result> { self.call_rpc_blocking(|inner| inner.contract_client.call_v2(call)) .map_err(map_err)