mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
companion for try-runtime revamp (#1997)
* companion for try-rutnime revamp * Fixes Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
@@ -696,21 +696,20 @@ impl_runtime_apis! {
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
impl frame_try_runtime::TryRuntime<Block> for Runtime {
|
||||
fn on_runtime_upgrade() -> (Weight, Weight) {
|
||||
log::info!("try-runtime::on_runtime_upgrade penpal.");
|
||||
let weight = Executive::try_runtime_upgrade().unwrap();
|
||||
fn on_runtime_upgrade(checks: bool) -> (Weight, Weight) {
|
||||
let weight = Executive::try_runtime_upgrade(checks).unwrap();
|
||||
(weight, RuntimeBlockWeights::get().max_block)
|
||||
}
|
||||
|
||||
fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight {
|
||||
log::info!(
|
||||
target: "runtime::penpal", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}",
|
||||
block.header.number,
|
||||
block.header.hash(),
|
||||
state_root_check,
|
||||
select,
|
||||
);
|
||||
Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed")
|
||||
fn execute_block(
|
||||
block: Block,
|
||||
state_root_check: bool,
|
||||
signature_check: bool,
|
||||
select: frame_try_runtime::TryStateSelect,
|
||||
) -> Weight {
|
||||
// NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to
|
||||
// have a backtrace here.
|
||||
Executive::try_execute_block(block, state_root_check, signature_check, select).unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user