mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 12:11:09 +00:00
follow-chain testing mode for try-runtime (and revamp CLI configs). (#9788)
* deadlock, need to ask someone to help now * Finally it seems to be working.. at least for a few blocks * self-review * major mega revamp * some small fixes * another mega refactor * add license * Apply suggestions from code review * hack around signature verification * Some fixes * Update utils/frame/try-runtime/cli/src/lib.rs Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com> * Update utils/frame/try-runtime/cli/src/lib.rs Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com> * Update utils/frame/try-runtime/cli/src/lib.rs Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com> * final tweaks, hopefully. * a little self-review * Add the ext root check Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com>
This commit is contained in:
@@ -220,6 +220,37 @@ where
|
||||
weight
|
||||
}
|
||||
|
||||
/// Execute given block, but don't do any of the [`final_checks`].
|
||||
///
|
||||
/// Should only be used for testing.
|
||||
#[cfg(feature = "try-runtime")]
|
||||
pub fn execute_block_no_check(block: Block) -> frame_support::weights::Weight {
|
||||
Self::initialize_block(block.header());
|
||||
Self::initial_checks(&block);
|
||||
|
||||
let (header, extrinsics) = block.deconstruct();
|
||||
|
||||
Self::execute_extrinsics_with_book_keeping(extrinsics, *header.number());
|
||||
|
||||
// do some of the checks that would normally happen in `final_checks`, but definitely skip
|
||||
// the state root check.
|
||||
{
|
||||
let new_header = <frame_system::Pallet<System>>::finalize();
|
||||
let items_zip = header.digest().logs().iter().zip(new_header.digest().logs().iter());
|
||||
for (header_item, computed_item) in items_zip {
|
||||
header_item.check_equal(&computed_item);
|
||||
assert!(header_item == computed_item, "Digest item must match that calculated.");
|
||||
}
|
||||
|
||||
assert!(
|
||||
header.extrinsics_root() == new_header.extrinsics_root(),
|
||||
"Transaction trie root must be valid.",
|
||||
);
|
||||
}
|
||||
|
||||
frame_system::Pallet::<System>::block_weight().total()
|
||||
}
|
||||
|
||||
/// Execute all `OnRuntimeUpgrade` of this runtime, including the pre and post migration checks.
|
||||
///
|
||||
/// This should only be used for testing.
|
||||
|
||||
Reference in New Issue
Block a user