Skip to content

Commit

Permalink
companion for substrate#9788 (#3858)
Browse files Browse the repository at this point in the history
* companion for paritytech/substrate#9788

* fmt

* Some fixes

* final fixes

* fix a few small things

* update Substrate

Co-authored-by: parity-processbot <>
  • Loading branch information
kianenigma authored Sep 21, 2021
1 parent e952c47 commit 6279896
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
9 changes: 6 additions & 3 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2016,10 +2016,13 @@ sp_api::impl_runtime_apis! {

#[cfg(feature = "try-runtime")]
impl frame_try_runtime::TryRuntime<Block> for Runtime {
fn on_runtime_upgrade() -> Result<(Weight, Weight), sp_runtime::RuntimeString> {
fn on_runtime_upgrade() -> (Weight, Weight) {
log::info!("try-runtime::on_runtime_upgrade kusama.");
let weight = Executive::try_runtime_upgrade()?;
Ok((weight, BlockWeights::get().max_block))
let weight = Executive::try_runtime_upgrade().unwrap();
(weight, BlockWeights::get().max_block)
}
fn execute_block_no_check(block: Block) -> Weight {
Executive::execute_block_no_check(block)
}
}

Expand Down
10 changes: 7 additions & 3 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1593,10 +1593,14 @@ sp_api::impl_runtime_apis! {

#[cfg(feature = "try-runtime")]
impl frame_try_runtime::TryRuntime<Block> for Runtime {
fn on_runtime_upgrade() -> Result<(Weight, Weight), sp_runtime::RuntimeString> {
fn on_runtime_upgrade() -> (Weight, Weight) {
log::info!("try-runtime::on_runtime_upgrade polkadot.");
let weight = Executive::try_runtime_upgrade()?;
Ok((weight, BlockWeights::get().max_block))
let weight = Executive::try_runtime_upgrade().unwrap();
(weight, BlockWeights::get().max_block)
}

fn execute_block_no_check(block: Block) -> Weight {
Executive::execute_block_no_check(block)
}
}

Expand Down

0 comments on commit 6279896

Please sign in to comment.