-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test pack #3 for Hiring Module #20
Conversation
- move code - reduce type visibility - add some comments
- move trait declaration
- fix ‘missing review period’ bug - add tests for bug fix
- change fixed u64 type to BlockNumber type alias - add on_finalize_should_deactivate_application_with_review_period_expired_cause() test
- update opening counters after modification
- add comment and #[allow(dead_code)] attribute to test::debug_print - apply rustfmt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, also on improving documentation.
I left some comments on one issue, please respond and let me know what you think.
src/test/on_finalize.rs
Outdated
} else { | ||
panic!("should be Active") | ||
} | ||
<Module<Test> as OnFinalize<BlockNumber>>::on_finalize(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be slightly strengthened, so that you actually call with arguments 1...N-1
first, and ensure that nothing happens in those steps, only in step N
there is actual processing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this is really opening_fixture.max_review_period_length+1
, right? is more clear, rather than what may seem like arbitrary constant.
src/test/on_finalize.rs
Outdated
panic!("should be Active") | ||
} | ||
|
||
<Module<Test> as OnFinalize<BlockNumber>>::on_finalize(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment as in on_finalize_should_deactivate_application_with_review_period_expired_cause
.
src/test/on_finalize.rs
Outdated
panic!("planned to be WaitingToBegin") | ||
} | ||
|
||
<Module<Test> as OnFinalize<BlockNumber>>::on_finalize(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment as in on_finalize_should_deactivate_application_with_review_period_expired_cause
.
- add on_finanlize() constant description - add finalization all blocks prior the test
Agree with both comments. Found a Parity recommendation on how to test on_finalize():
|
Excellent work, that was a really nice solution, could you add it to the conventions issue? |
Contains tests for:
Code was refactored:
Bug fixes:
Numerous comments were added.