Unverified Commit 481dd290 authored by Kian Paimani's avatar Kian Paimani Committed by GitHub
Browse files

companion for substrate#9788 (#3858)

* companion for https://github.com/paritytech/substrate/pull/9788

* fmt

* Some fixes

* final fixes

* fix a few small things

* update Substrate

Co-authored-by: parity-processbot <>
parent c406f7b7
Pipeline #158494 canceled with stages
in 11 minutes
This diff is collapsed.
......@@ -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)
}
}
......
......@@ -143,8 +143,9 @@ impl fmt::Debug for OutboundHrmpAcceptanceErr {
"more HRMP messages than permitted by config ({} > {})",
sent, permitted,
),
NotSorted { idx } =>
write!(fmt, "the HRMP messages are not sorted (first unsorted is at index {})", idx,),
NotSorted { idx } => {
write!(fmt, "the HRMP messages are not sorted (first unsorted is at index {})", idx,)
},
NoSuchChannel { idx, channel_id } => write!(
fmt,
"the HRMP message at index {} is sent to a non existent channel {:?}->{:?}",
......
......@@ -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)
}
}
......
......@@ -1441,10 +1441,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 westend.");
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)
}
}
......
......@@ -41,7 +41,7 @@ pub(crate) async fn test_voter_bags_migration<
let mut ext = Builder::<Block>::new()
.mode(Mode::Online(OnlineConfig {
transport: ws_url.to_string().into(),
modules: vec!["Staking".to_string()],
pallets: vec!["Staking".to_string()],
at: None,
state_snapshot: None,
}))
......
......@@ -389,15 +389,15 @@ async fn create_election_ext<T: EPM::Config, B: BlockT>(
use frame_support::{storage::generator::StorageMap, traits::PalletInfo};
use sp_core::hashing::twox_128;
let mut modules = vec![<T as frame_system::Config>::PalletInfo::name::<EPM::Pallet<T>>()
let mut pallets = vec![<T as frame_system::Config>::PalletInfo::name::<EPM::Pallet<T>>()
.expect("Pallet always has name; qed.")
.to_string()];
modules.extend(additional);
pallets.extend(additional);
Builder::<B>::new()
.mode(Mode::Online(OnlineConfig {
transport: uri.into(),
at,
modules,
pallets,
..Default::default()
}))
.inject_hashed_prefix(&<frame_system::BlockHash<T>>::prefix_hash())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment