mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 12:31:03 +00:00
Improved election pallet testing (#12327)
* Improved election pallet testing * fmt * remove comment * more checks * fixes in logic * roll_to_signed * switch to roll_to_signed * Update frame/election-provider-multi-phase/src/mock.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * remove useless checks * remove warning * add checks to signed.rs * add some checks to unsigned.rs * fmt * use roll_to_signed and roll_to_unsigned * remove nonsense * remove even more nonsense * fix * fix * remove useless checks Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -99,6 +99,17 @@ pub fn roll_to(n: BlockNumber) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn roll_to_unsigned() {
|
||||
while !matches!(MultiPhase::current_phase(), Phase::Unsigned(_)) {
|
||||
roll_to(System::block_number() + 1);
|
||||
}
|
||||
}
|
||||
pub fn roll_to_signed() {
|
||||
while !matches!(MultiPhase::current_phase(), Phase::Signed) {
|
||||
roll_to(System::block_number() + 1);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn roll_to_with_ocw(n: BlockNumber) {
|
||||
let now = System::block_number();
|
||||
for i in now + 1..=n {
|
||||
|
||||
Reference in New Issue
Block a user