Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Commit

Permalink
fixed compilation 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Navoichyk committed Sep 30, 2022
1 parent 5315bd8 commit 9553d3a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test-utils/runtime/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,10 @@ pub fn execute_transaction(utx: Extrinsic) -> ApplyExtrinsicResult {

/// Finalize the block.
pub fn finalize_block() -> Header {
use sp_core::storage::StateVersion;
let extrinsic_index: u32 = storage::unhashed::take(well_known_keys::EXTRINSIC_INDEX).unwrap();
let txs: Vec<_> = (0..extrinsic_index).map(ExtrinsicData::take).collect();
let extrinsics_root = trie::blake2_256_ordered_root(txs);
let extrinsics_root = trie::blake2_256_ordered_root(txs, StateVersion::V0);
let number = <Number>::take().expect("Number is set by `initialize_block`");
let parent_hash = <ParentHash>::take();
let mut digest = <StorageDigest>::take().expect("StorageDigest is set by `initialize_block`");
Expand All @@ -205,8 +206,8 @@ pub fn finalize_block() -> Header {

// This MUST come after all changes to storage are done. Otherwise we will fail the
// “Storage root does not match that calculated” assertion.
let storage_root =
Hash::decode(&mut &storage_root()[..]).expect("`storage_root` is a valid hash");
let storage_root = Hash::decode(&mut &storage_root(StateVersion::V1)[..])
.expect("`storage_root` is a valid hash");

if let Some(new_authorities) = o_new_authorities {
digest.push(generic::DigestItem::Consensus(*b"aura", new_authorities.encode()));
Expand Down

0 comments on commit 9553d3a

Please sign in to comment.