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:
Kian Paimani
2021-12-02 14:00:54 +01:00
committed by GitHub
parent ca81203b83
commit e70f7fd016
23 changed files with 189 additions and 10 deletions
+2
View File
@@ -60,3 +60,5 @@ std = [
"pallet-authorship/std",
"pallet-session/std",
]
try-runtime = [ "frame-support/try-runtime" ]
@@ -88,7 +88,7 @@ fn register_validators<T: Config + session::Config>(count: u32) {
let validators = (0..count).map(|c| validator::<T>(c)).collect::<Vec<_>>();
for (who, keys) in validators {
<session::Module<T>>::set_keys(RawOrigin::Signed(who).into(), keys, Vec::new()).unwrap();
<session::Pallet<T>>::set_keys(RawOrigin::Signed(who).into(), keys, Vec::new()).unwrap();
}
}
+1 -3
View File
@@ -18,7 +18,7 @@
#![cfg(feature = "runtime-benchmarks")]
use sp_std::{prelude::*, vec};
use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, whitelisted_caller};
use frame_benchmarking::{benchmarks, whitelisted_caller};
use frame_system::RawOrigin;
use pallet_session::*;
pub struct Pallet<T: Config>(pallet_session::Pallet<T>);
@@ -39,6 +39,4 @@ benchmarks! {
let proof: Vec<u8> = vec![0,1,2,3];
let _t = pallet_session::Pallet::<T>::set_keys(RawOrigin::Signed(caller.clone()).into(), keys, proof);
}: _(RawOrigin::Signed(caller))
}
impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test, extra = false,);