mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-21 21:25:41 +00:00
This PR adds support for fetching the closest merkle value of some key. Builds on top of - https://github.com/paritytech/trie/pull/199 Migrates https://github.com/paritytech/substrate/pull/14818 to the monorepo. Closes: https://github.com/paritytech/substrate/issues/14550 Closes: https://github.com/paritytech/polkadot-sdk/issues/1506 // @paritytech/subxt-team --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
This commit is contained in:
@@ -27,7 +27,7 @@ use crate::{
|
||||
api::ChainHeadApiServer,
|
||||
chain_head_follow::ChainHeadFollower,
|
||||
error::Error as ChainHeadRpcError,
|
||||
event::{FollowEvent, MethodResponse, OperationError, StorageQuery, StorageQueryType},
|
||||
event::{FollowEvent, MethodResponse, OperationError, StorageQuery},
|
||||
hex_string,
|
||||
subscription::{SubscriptionManagement, SubscriptionManagementError},
|
||||
},
|
||||
@@ -329,19 +329,10 @@ where
|
||||
let items = items
|
||||
.into_iter()
|
||||
.map(|query| {
|
||||
if query.query_type == StorageQueryType::ClosestDescendantMerkleValue {
|
||||
// Note: remove this once all types are implemented.
|
||||
return Err(ChainHeadRpcError::InvalidParam(
|
||||
"Storage query type not supported".into(),
|
||||
))
|
||||
}
|
||||
|
||||
Ok(StorageQuery {
|
||||
key: StorageKey(parse_hex_param(query.key)?),
|
||||
query_type: query.query_type,
|
||||
})
|
||||
let key = StorageKey(parse_hex_param(query.key)?);
|
||||
Ok(StorageQuery { key, query_type: query.query_type })
|
||||
})
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
.collect::<Result<Vec<_>, ChainHeadRpcError>>()?;
|
||||
|
||||
let child_trie = child_trie
|
||||
.map(|child_trie| parse_hex_param(child_trie))
|
||||
|
||||
Reference in New Issue
Block a user