Skip to content

Conversation

@remagpie
Copy link
Contributor

@remagpie remagpie commented Dec 3, 2019

Depends: #1916


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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is - 2 right?

Copy link
Contributor Author

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.

@remagpie remagpie force-pushed the aggregate-work-info branch from 5ca3333 to 6b4ee35 Compare December 5, 2019 02:40
@remagpie remagpie changed the base branch from era to master December 5, 2019 09:16
@remagpie remagpie force-pushed the aggregate-work-info branch from 6b4ee35 to 89dc8a3 Compare December 5, 2019 09:25
@remagpie
Copy link
Contributor Author

remagpie commented Dec 5, 2019

I rebased the PR to @foriequal0 's refactoring branch.
Only the last commit is the new commit.

@remagpie remagpie added the do-not-merge Do not merge (for mergify.io) label Dec 5, 2019
@sgkim126 sgkim126 requested a review from foriequal0 December 5, 2019 16:34
@sgkim126
Copy link
Contributor

sgkim126 commented Dec 5, 2019

@foriequal0 It looks good to me, but would you double-check?

foriequal0
foriequal0 previously approved these changes Dec 6, 2019
@remagpie remagpie removed the do-not-merge Do not merge (for mergify.io) label Dec 9, 2019
@remagpie remagpie merged commit 79322e1 into CodeChain-io:master Dec 9, 2019
@remagpie remagpie deleted the aggregate-work-info branch December 9, 2019 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants