Skip to content
Prev Previous commit
Next Next commit
Remove unnecessary mocked function
  • Loading branch information
ernestognw committed Mar 26, 2024
commit 0d65264751f5b9ba8a276d7fd30d40a65fdeaa4e
8 changes: 0 additions & 8 deletions contracts/mocks/ArraysMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ contract Uint256ArraysMock {
return _array.unsafeAccess(pos).value;
}

function unsafeMemoryAccess(uint256[] memory array, uint256 pos) external pure returns (uint256) {
return array.unsafeMemoryAccess(pos);
}

function sort(uint256[] memory array) external pure returns (uint256[] memory) {
return array.sort();
}
Expand Down Expand Up @@ -75,10 +71,6 @@ contract AddressArraysMock {
return _array.unsafeAccess(pos).value;
}

function unsafeMemoryAccess(address[] memory array, uint256 pos) external pure returns (address) {
return array.unsafeMemoryAccess(pos);
}

function sort(address[] memory array) external pure returns (address[] memory) {
return array.sort();
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/generate/templates/Arrays.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function _swap(uint256 ptr1, uint256 ptr2) private pure {
}
`;

const bounds = `
const search = `
/**
* @dev Searches a sorted \`array\` and returns the first index that contains
* a value greater or equal to \`element\`. If no such index exists (i.e. all
Expand Down Expand Up @@ -381,7 +381,7 @@ module.exports = format(
...TYPES.map(sortHelpers),
pointers,
quickSort,
bounds,
search,
...TYPES.map(unsafeAccessStorage),
...TYPES.map(unsafeAccessMemory),
...TYPES.map(unsafeSetLength),
Expand Down