Allow operational recovery path if on_initialize use fullblock. (#6089)

* note_preimage using operational

* Update frame/democracy/src/lib.rs

Co-authored-by: Gavin Wood <gavin@parity.io>
This commit is contained in:
thiolliere
2020-05-21 13:51:47 +02:00
committed by GitHub
parent 6c47b130e8
commit b50c3338d6
4 changed files with 138 additions and 67 deletions
+7
View File
@@ -187,6 +187,7 @@ impl super::Trait for Test {
type InstantAllowed = InstantAllowed;
type Scheduler = Scheduler;
type MaxVotes = MaxVotes;
type OperationalPreimageOrigin = EnsureSignedBy<Six, u64>;
}
pub fn new_test_ext() -> sp_io::TestExternalities {
@@ -200,6 +201,12 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
ext
}
/// Execute the function two times, with `true` and with `false`.
pub fn new_test_ext_execute_with_cond(execute: impl FnOnce(bool) -> () + Clone) {
new_test_ext().execute_with(|| (execute.clone())(false));
new_test_ext().execute_with(|| execute(true));
}
type System = frame_system::Module<Test>;
type Balances = pallet_balances::Module<Test>;
type Scheduler = pallet_scheduler::Module<Test>;