mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 14:27:57 +00:00
fix digest in check_execution_proof (#3469)
This commit is contained in:
committed by
Gavin Wood
parent
a528b7dc56
commit
e9273329ae
@@ -62,6 +62,12 @@ pub fn initialize_block(header: &Header) {
|
||||
<ParentHash>::put(&header.parent_hash);
|
||||
<StorageDigest>::put(header.digest());
|
||||
storage::unhashed::put(well_known_keys::EXTRINSIC_INDEX, &0u32);
|
||||
|
||||
// try to read something that depends on current header digest
|
||||
// so that it'll be included in execution proof
|
||||
if let Some(generic::DigestItem::Other(v)) = header.digest().logs().iter().next() {
|
||||
let _: Option<u32> = storage::unhashed::get(&v);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_block_number() -> Option<BlockNumber> {
|
||||
@@ -104,6 +110,12 @@ fn execute_block_with_state_root_handler(
|
||||
assert!(txs_root == header.extrinsics_root, "Transaction trie root must be valid.");
|
||||
}
|
||||
|
||||
// try to read something that depends on current header digest
|
||||
// so that it'll be included in execution proof
|
||||
if let Some(generic::DigestItem::Other(v)) = header.digest().logs().iter().next() {
|
||||
let _: Option<u32> = storage::unhashed::get(&v);
|
||||
}
|
||||
|
||||
// execute transactions
|
||||
block.extrinsics.iter().enumerate().for_each(|(i, e)| {
|
||||
storage::unhashed::put(well_known_keys::EXTRINSIC_INDEX, &(i as u32));
|
||||
|
||||
Reference in New Issue
Block a user