Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Correct the sides of the given and expected args
  • Loading branch information
pepyakin committed Jul 27, 2018
commit f1509a32e2ad141d56589db84bc5ff6147a0ca0c
8 changes: 4 additions & 4 deletions substrate/test-runtime/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ pub fn execute_block(block: Block) {
let txs = block.extrinsics.iter().map(Encode::encode).collect::<Vec<_>>();
let txs = txs.iter().map(Vec::as_slice).collect::<Vec<_>>();
let txs_root = enumerated_trie_root(&txs).into();
info_expect_equal_hash(&header.extrinsics_root, &txs_root);
assert!(header.extrinsics_root == txs_root, "Transaction trie root must be valid.");
info_expect_equal_hash(&txs_root, &header.extrinsics_root);
assert!(txs_root == header.extrinsics_root, "Transaction trie root must be valid.");

// execute transactions
block.extrinsics.iter().for_each(|e| { execute_transaction_backend(e).map_err(|_| ()).expect("Extrinsic error"); });

// check storage root.
let storage_root = storage_root().into();
info_expect_equal_hash(&header.state_root, &storage_root);
assert!(header.state_root == storage_root, "Storage root must match that calculated.");
info_expect_equal_hash(&storage_root, &header.state_root);
assert!(storage_root == header.state_root, "Storage root must match that calculated.");
}

/// Execute a transaction outside of the block execution function.
Expand Down