axieinfinity/ronin-dpos-contracts

Invalid function `epochOf()`

ducthotran2010 opened this issue · 1 comments

    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;
}

    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