mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 07:01:03 +00:00
Integrate try-runtime into cumulus (#793)
* almost integrate * revert branch changes * remove extra deps * some review comments' * Fix a bunch of stuff * Update parachain-template/node/Cargo.toml Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> * Fix * Fix * fix benchmark * fmt * Remove wrong bench test Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
This commit is contained in:
@@ -73,6 +73,9 @@ xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features
|
||||
xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
|
||||
pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }
|
||||
|
||||
# Try-runtime stuff
|
||||
frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true , branch = "master" }
|
||||
|
||||
[dev-dependencies]
|
||||
hex-literal = "0.3.1"
|
||||
|
||||
@@ -100,6 +103,10 @@ runtime-benchmarks = [
|
||||
"pallet-xcm/runtime-benchmarks",
|
||||
"pallet-collator-selection/runtime-benchmarks",
|
||||
]
|
||||
try-runtime = [
|
||||
"frame-try-runtime",
|
||||
"frame-executive/try-runtime",
|
||||
]
|
||||
std = [
|
||||
"codec/std",
|
||||
"scale-info/std",
|
||||
|
||||
@@ -890,6 +890,19 @@ 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 statemint.");
|
||||
let weight = Executive::try_runtime_upgrade().unwrap();
|
||||
(weight, RuntimeBlockWeights::get().max_block)
|
||||
}
|
||||
|
||||
fn execute_block_no_check(block: Block) -> Weight {
|
||||
Executive::execute_block_no_check(block)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
impl frame_benchmarking::Benchmark<Block> for Runtime {
|
||||
fn benchmark_metadata(extra: bool) -> (
|
||||
|
||||
Reference in New Issue
Block a user