This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Fix test for Substrate#9898 #9907
Merged
emostov merged 1 commit intokiz-improve-ocw-resubmitfrom Oct 1, 2021
Merged
Conversation
emostov
commented
Oct 1, 2021
| roll_to(25); | ||
| assert_eq!(MultiPhase::current_phase(), Phase::Unsigned((true, 25))); | ||
| const BLOCK: u64 = 25; | ||
| let block_plus = |delta: u64| BLOCK + delta; |
Contributor
Author
There was a problem hiding this comment.
this is an idiom taken from the other tests in this file
emostov
commented
Oct 1, 2021
| // we must clear the offchain storage to ensure the offchain execution check doesn't get | ||
| // in the way. | ||
| let mut storage = StorageValueRef::persistent(&OFFCHAIN_LAST_BLOCK); | ||
| storage.clear(); |
Contributor
Author
There was a problem hiding this comment.
clearing the storage here appears to be irrelevant because it starts out empty
Contributor
There was a problem hiding this comment.
I actually always thought it to be an overkill and wanted to remove it :p
emostov
commented
Oct 1, 2021
|
|
||
| // after an election, the solution is not cleared | ||
| // we don't actually care about the result of the election | ||
| roll_to(26); |
Contributor
Author
There was a problem hiding this comment.
afaict every call to roll_to after the first is not relevant to the test
ghost
pushed a commit
that referenced
this pull request
Oct 5, 2021
* dont read events in elections anymore. * Update frame/election-provider-multi-phase/src/lib.rs * Fix test for Substrate#9898 (#9907) Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
target branch: kiz-improve-ocw-resubmit
target pr: #9898
Prior to #9898, the election OCW cleared its cached solution whenever it saw events from
do_elect. Now, the election OCW only clears its solution when run on the first block of the unsigned phase. In this PR the relevant test is updated to try and document the change.