Improve some NatSpec (#3809)

Co-authored-by: JulissaDantes <julissadcj@gmail.com>
(cherry picked from commit 8f8fd84f1e)
This commit is contained in:
Francisco
2022-11-25 12:55:16 -03:00
committed by Francisco Giordano
parent 49c0e4370d
commit 53eb531255
4 changed files with 33 additions and 5 deletions

View File

@ -67,7 +67,8 @@ function upperLookup(${opts.historyTypeName} storage self, ${opts.keyTypeName} k
const legacyOperations = opts => `\
/**
* @dev Returns the value at a given block number. If a checkpoint is not available at that block, the closest one
* before it is returned, or zero otherwise.
* before it is returned, or zero otherwise. Because the number returned corresponds to that at the end of the
* block, the requested block number must be in the past, excluding the current block.
*/
function getAtBlock(${opts.historyTypeName} storage self, uint256 blockNumber) internal view returns (uint256) {
require(blockNumber < block.number, "Checkpoints: block not yet mined");
@ -246,6 +247,9 @@ function _lowerBinaryLookup(
return high;
}
/**
* @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.
*/
function _unsafeAccess(${opts.checkpointTypeName}[] storage self, uint256 pos)
private
pure