mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-29 03:15:43 +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:
@@ -20,8 +20,8 @@ use parking_lot::Mutex;
|
||||
use sc_client_api::{
|
||||
execution_extensions::ExecutionExtensions, BlockBackend, BlockImportNotification,
|
||||
BlockchainEvents, CallExecutor, ChildInfo, ExecutorProvider, FinalityNotification,
|
||||
FinalityNotifications, FinalizeSummary, ImportNotifications, KeysIter, PairsIter, StorageData,
|
||||
StorageEventStream, StorageKey, StorageProvider,
|
||||
FinalityNotifications, FinalizeSummary, ImportNotifications, KeysIter, MerkleValue, PairsIter,
|
||||
StorageData, StorageEventStream, StorageKey, StorageProvider,
|
||||
};
|
||||
use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedSender};
|
||||
use sp_api::{CallApiAt, CallApiAtParams, NumberFor, RuntimeVersion};
|
||||
@@ -198,6 +198,23 @@ impl<
|
||||
) -> sp_blockchain::Result<Option<Block::Hash>> {
|
||||
self.client.child_storage_hash(hash, child_info, key)
|
||||
}
|
||||
|
||||
fn closest_merkle_value(
|
||||
&self,
|
||||
hash: Block::Hash,
|
||||
key: &StorageKey,
|
||||
) -> sp_blockchain::Result<Option<MerkleValue<Block::Hash>>> {
|
||||
self.client.closest_merkle_value(hash, key)
|
||||
}
|
||||
|
||||
fn child_closest_merkle_value(
|
||||
&self,
|
||||
hash: Block::Hash,
|
||||
child_info: &ChildInfo,
|
||||
key: &StorageKey,
|
||||
) -> sp_blockchain::Result<Option<MerkleValue<Block::Hash>>> {
|
||||
self.client.child_closest_merkle_value(hash, child_info, key)
|
||||
}
|
||||
}
|
||||
|
||||
impl<Block: BlockT, Client: CallApiAt<Block>> CallApiAt<Block> for ChainHeadMockClient<Client> {
|
||||
|
||||
Reference in New Issue
Block a user