Skip to content
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

Invalid function epochOf() #51

Closed
ducthotran2010 opened this issue Nov 4, 2022 · 1 comment · Fixed by #81
Closed

Invalid function epochOf() #51

ducthotran2010 opened this issue Nov 4, 2022 · 1 comment · Fixed by #81

Comments

@ducthotran2010
Copy link
Collaborator

ducthotran2010 commented Nov 4, 2022

    This looks incorrect but has no impacts, so block 0 -> epoch 0, block 1,2,3,... -> epoch 1?

Originally posted by @minh-bq in #22 (comment)

function epochOf(uint256 _block) public view virtual override returns (uint256) {
return _block == 0 ? 0 : _block / _numberOfBlocksInEpoch + 1;
}

@ducthotran2010
Copy link
Collaborator Author

ducthotran2010 commented Nov 4, 2022

    These might break if the `_numberOfBlocksInEpoch` and `_numberOfEpochsInPeriod` change.

Originally posted by @nxqbao in #22 (comment)

* @inheritdoc IRoninValidatorSet
*/
function setNumberOfBlocksInEpoch(uint256 _number) external override onlyAdmin {
_setNumberOfBlocksInEpoch(_number);
}

Update: This issue is fixed in #80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant