-
Notifications
You must be signed in to change notification settings - Fork 51
Extract aggregate_work_info function #1908
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
Conversation
|
|
||
| let start_of_the_current_term = { | ||
| let end_of_the_last_term = | ||
| chain.last_term_finished_block_num((start_of_the_next_term_header.number() - 2).into()).unwrap(); |
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.
Is - 2 right?
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.
Yes, it's right.
End of the current term = block@(Start of the next term - 1)
End of the last term = block@((End of the current term - 1).metadata.lastTermFinished)
It becomes a bit different if the current term has only one block, but surprisingly, the final formula remains the same.
5ca3333 to
6b4ee35
Compare
6b4ee35 to
89dc8a3
Compare
|
I rebased the PR to @foriequal0 's refactoring branch. |
|
@foriequal0 It looks good to me, but would you double-check? |
89dc8a3 to
cf7a45a
Compare
Depends: #1916