Scoru,Test: checks the challenge window period boundaries
Context
While looking at the constants declaration to tackle #2980 (closed), I was a bit surprised that the challenge window period is non-inclusive. I extended a test to expose this behavior (it can be fine to leave as is but we need to be sure about the boundaries).
IT WAS WRONG:
The challenge window perido is inclusive, if you wait:
-
n - 1
blocks : NOT GOOD -
n
blocks: GOOD😄
So in summary, the mr is an integration test testing these bounds. I also included a small refactoring about if ... then fail ...
patterns.
Manually testing the MR
The CI should prevail (but do not trust the flakiness :p).
Checklist
- n/a Document the interface of any function added or modified (see the coding guidelines)
- n/a Document any change to the user interface, including configuration parameters (see node configuration)
-
Provide automatic testing (see the testing guide). - n/a For new features and bug fixes, add an item in the appropriate changelog (
docs/protocols/alpha.rst
for the protocol and the environment,CHANGES.rst
at the root of the repository for everything else). -
Select suitable reviewers using the Reviewers
field below. -
Select as Assignee
the next person who should take action on that MR
Edited by Valentin Chaboche