mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 18:41:05 +00:00
This reverts commit 6ee39261c8.
This commit is contained in:
@@ -41,7 +41,8 @@ use sp_runtime::{
|
||||
use sp_state_machine::{
|
||||
DBValue, Backend as StateBackend, ChangesTrieAnchorBlockId,
|
||||
prove_read, prove_child_read, ChangesTrieRootsStorage, ChangesTrieStorage,
|
||||
ChangesTrieConfigurationRange, key_changes, key_changes_proof,
|
||||
ChangesTrieConfigurationRange, key_changes, key_changes_proof, StorageProof,
|
||||
merge_storage_proofs,
|
||||
};
|
||||
use sc_executor::{RuntimeVersion, RuntimeInfo};
|
||||
use sp_consensus::{
|
||||
@@ -54,7 +55,6 @@ use sp_blockchain::{self as blockchain,
|
||||
well_known_cache_keys::Id as CacheKeyId,
|
||||
HeaderMetadata, CachedHeaderMetadata,
|
||||
};
|
||||
use sp_trie::StorageProof;
|
||||
|
||||
use sp_api::{
|
||||
CallApiAt, ConstructRuntimeApi, Core as CoreApi, ApiExt, ApiRef, ProvideRuntimeApi,
|
||||
@@ -482,19 +482,9 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
|
||||
method: &str,
|
||||
call_data: &[u8]
|
||||
) -> sp_blockchain::Result<(Vec<u8>, StorageProof)> {
|
||||
// Make sure we include the `:code` and `:heap_pages` in the execution proof to be
|
||||
// backwards compatible.
|
||||
//
|
||||
// TODO: Remove when solved: https://github.com/paritytech/substrate/issues/5047
|
||||
let code_proof = self.read_proof(
|
||||
id,
|
||||
&[well_known_keys::CODE.to_vec(), well_known_keys::HEAP_PAGES.to_vec()],
|
||||
)?;
|
||||
|
||||
let state = self.state_at(id)?;
|
||||
let header = self.prepare_environment_block(id)?;
|
||||
prove_execution(state, header, &self.executor, method, call_data)
|
||||
.map(|p| (p.0, StorageProof::merge(vec![p.1, code_proof])))
|
||||
}
|
||||
|
||||
/// Reads given header and generates CHT-based header proof.
|
||||
@@ -779,7 +769,7 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
|
||||
Ok(())
|
||||
}, ())?;
|
||||
|
||||
Ok(StorageProof::merge(proofs))
|
||||
Ok(merge_storage_proofs(proofs))
|
||||
}
|
||||
|
||||
/// Generates CHT-based proof for roots of changes tries at given blocks (that are part of single CHT).
|
||||
|
||||
Reference in New Issue
Block a user