Optimize votes lookups for recent checkpoints (#3673)
This commit is contained in:
@ -26,8 +26,8 @@ contract CheckpointsMock {
|
||||
return _totalCheckpoints.getAtBlock(blockNumber);
|
||||
}
|
||||
|
||||
function getAtRecentBlock(uint256 blockNumber) public view returns (uint256) {
|
||||
return _totalCheckpoints.getAtRecentBlock(blockNumber);
|
||||
function getAtProbablyRecentBlock(uint256 blockNumber) public view returns (uint256) {
|
||||
return _totalCheckpoints.getAtProbablyRecentBlock(blockNumber);
|
||||
}
|
||||
|
||||
function length() public view returns (uint256) {
|
||||
@ -58,10 +58,6 @@ contract Checkpoints${length}Mock {
|
||||
return _totalCheckpoints.upperLookup(key);
|
||||
}
|
||||
|
||||
function upperLookupRecent(uint${256 - length} key) public view returns (uint224) {
|
||||
return _totalCheckpoints.upperLookupRecent(key);
|
||||
}
|
||||
|
||||
function length() public view returns (uint256) {
|
||||
return _totalCheckpoints._checkpoints.length;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user