This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Improve election pallet testing setup and checks #12184
Copy link
Copy link
Closed
Labels
Z1-easyCan be fixed primarily by duplicating and adapting code by an intermediate coderCan be fixed primarily by duplicating and adapting code by an intermediate coderZ6-mentorAn easy task where a mentor is available. Please indicate in the issue who the mentor could be.An easy task where a mentor is available. Please indicate in the issue who the mentor could be.
Description
Recently, we added some events to some of the tests in pallet-election-provider-multi-phase.
This is generally a good patterns and I want all tests to basically finish with an assertion over the events that got fired during the tests. The author should verify that the events are sensible to the best of their abilities.
Here is another example: #11343
Lastly, in some experimental work, I've replaced all of the roll_to(x) to roll_to_eventName. We want all tests to use this pattern as well, for less breaking changes.
For example, almost all of the cases where we roll_to(15), we want to roll_to_unsigned().
substrate/frame/election-provider-multi-block/src/mock/mod.rs
Lines 548 to 559 in d7e45e5
| pub fn roll_to_unsigned_open() { | |
| while !matches!(MultiBlock::current_phase(), Phase::Unsigned(_)) { | |
| roll_next() | |
| } | |
| } | |
| /// proceed block number to whenever the signed phase is open (`Phase::Signed(_)`). | |
| pub fn roll_to_signed_open() { | |
| while !matches!(MultiBlock::current_phase(), Phase::Signed) { | |
| roll_next(); | |
| } | |
| } |
Metadata
Metadata
Assignees
Labels
Z1-easyCan be fixed primarily by duplicating and adapting code by an intermediate coderCan be fixed primarily by duplicating and adapting code by an intermediate coderZ6-mentorAn easy task where a mentor is available. Please indicate in the issue who the mentor could be.An easy task where a mentor is available. Please indicate in the issue who the mentor could be.
Type
Projects
Status
✅ Done