Skip to content

Commit

Permalink
♻️ Fix Visibility Modifiers in Tests
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
  • Loading branch information
pcaversaccio committed Mar 12, 2024
1 parent aec2fab commit 75601b6
Show file tree
Hide file tree
Showing 17 changed files with 721 additions and 721 deletions.
1,224 changes: 612 additions & 612 deletions .gas-snapshot

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions test/auth/AccessControl.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ contract AccessControlTest is Test {
);
}

function testSupportsInterfaceSuccess() public {
function testSupportsInterfaceSuccess() public view {
assertTrue(accessControl.supportsInterface(type(IERC165).interfaceId));
assertTrue(
accessControl.supportsInterface(type(IAccessControl).interfaceId)
);
}

function testSupportsInterfaceSuccessGasCost() public {
function testSupportsInterfaceSuccessGasCost() public view {
uint256 startGas = gasleft();
accessControl.supportsInterface(type(IERC165).interfaceId);
uint256 gasUsed = startGas - gasleft();
Expand All @@ -108,11 +108,11 @@ contract AccessControlTest is Test {
);
}

function testSupportsInterfaceInvalidInterfaceId() public {
function testSupportsInterfaceInvalidInterfaceId() public view {
assertTrue(!accessControl.supportsInterface(0x0011bbff));
}

function testSupportsInterfaceInvalidInterfaceIdGasCost() public {
function testSupportsInterfaceInvalidInterfaceIdGasCost() public view {
uint256 startGas = gasleft();
accessControl.supportsInterface(0x0011bbff);
uint256 gasUsed = startGas - gasleft();
Expand Down Expand Up @@ -657,7 +657,7 @@ contract AccessControlInvariants is Test {
targetContract(address(accessControlHandler));
}

function invariantHasRole() public {
function invariantHasRole() public view {
assertEq(
accessControl.hasRole(DEFAULT_ADMIN_ROLE, deployer),
accessControlHandler.hasRole(DEFAULT_ADMIN_ROLE, deployer)
Expand All @@ -672,7 +672,7 @@ contract AccessControlInvariants is Test {
);
}

function invariantGetRoleAdmin() public {
function invariantGetRoleAdmin() public view {
assertEq(
accessControl.getRoleAdmin(DEFAULT_ADMIN_ROLE),
accessControlHandler.getRoleAdmin(DEFAULT_ADMIN_ROLE)
Expand Down
4 changes: 2 additions & 2 deletions test/auth/Ownable.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ contract OwnableTest is Test {
assertEq(ownableInitialEvent.owner(), deployer);
}

function testHasOwner() public {
function testHasOwner() public view {
assertEq(ownable.owner(), deployer);
}

Expand Down Expand Up @@ -148,7 +148,7 @@ contract OwnableInvariants is Test {
targetContract(address(ownerHandler));
}

function invariantOwner() public {
function invariantOwner() public view {
assertEq(ownable.owner(), ownerHandler.owner());
}
}
Expand Down
6 changes: 3 additions & 3 deletions test/auth/Ownable2Step.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ contract Ownable2StepTest is Test {
assertEq(ownable2StepInitialEvent.pending_owner(), zeroAddress);
}

function testHasOwner() public {
function testHasOwner() public view {
assertEq(ownable2Step.owner(), deployer);
}

Expand Down Expand Up @@ -295,11 +295,11 @@ contract Ownable2StepInvariants is Test {
targetContract(address(owner2StepHandler));
}

function invariantOwner() public {
function invariantOwner() public view {
assertEq(ownable2Step.owner(), owner2StepHandler.owner());
}

function invariantPendingOwner() public {
function invariantPendingOwner() public view {
assertEq(
ownable2Step.pending_owner(),
owner2StepHandler.pending_owner()
Expand Down
12 changes: 6 additions & 6 deletions test/extensions/ERC2981.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ contract ERC2981Test is Test {
assertEq(royaltyAmountInitialSetup, 0);
}

function testSupportsInterfaceSuccess() public {
function testSupportsInterfaceSuccess() public view {
assertTrue(
ERC2981Extended.supportsInterface(type(IERC165).interfaceId)
);
Expand All @@ -60,7 +60,7 @@ contract ERC2981Test is Test {
);
}

function testSupportsInterfaceSuccessGasCost() public {
function testSupportsInterfaceSuccessGasCost() public view {
uint256 startGas = gasleft();
ERC2981Extended.supportsInterface(type(IERC165).interfaceId);
uint256 gasUsed = startGas - gasleft();
Expand All @@ -70,11 +70,11 @@ contract ERC2981Test is Test {
);
}

function testSupportsInterfaceInvalidInterfaceId() public {
function testSupportsInterfaceInvalidInterfaceId() public view {
assertTrue(!ERC2981Extended.supportsInterface(0x0011bbff));
}

function testSupportsInterfaceInvalidInterfaceIdGasCost() public {
function testSupportsInterfaceInvalidInterfaceIdGasCost() public view {
uint256 startGas = gasleft();
ERC2981Extended.supportsInterface(0x0011bbff);
uint256 gasUsed = startGas - gasleft();
Expand Down Expand Up @@ -355,7 +355,7 @@ contract ERC2981Test is Test {
ERC2981Extended.reset_token_royalty(1);
}

function testHasOwner() public {
function testHasOwner() public view {
assertEq(ERC2981Extended.owner(), deployer);
}

Expand Down Expand Up @@ -782,7 +782,7 @@ contract ERC2981Invariants is Test {
targetSender(deployer);
}

function invariantOwner() public {
function invariantOwner() public view {
assertEq(ERC2981Extended.owner(), erc2981Handler.owner());
}
}
Expand Down
8 changes: 4 additions & 4 deletions test/extensions/ERC4626.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1849,7 +1849,7 @@ contract ERC4626VaultTest is ERC4626Test {
);
}

function testCachedDomainSeparator() public {
function testCachedDomainSeparator() public view {
assertEq(
ERC4626ExtendedDecimalsOffset0.DOMAIN_SEPARATOR(),
_CACHED_DOMAIN_SEPARATOR
Expand All @@ -1870,7 +1870,7 @@ contract ERC4626VaultTest is ERC4626Test {
assertEq(ERC4626ExtendedDecimalsOffset0.DOMAIN_SEPARATOR(), digest);
}

function testEIP712Domain() public {
function testEIP712Domain() public view {
(
bytes1 fields,
string memory name,
Expand Down Expand Up @@ -2100,14 +2100,14 @@ contract ERC4626VaultInvariants is Test {
targetSender(deployer);
}

function invariantTotalSupply() public {
function invariantTotalSupply() public view {
assertEq(
ERC4626Extended.totalSupply(),
erc4626VaultHandler.totalSupply()
);
}

function invariantTotalAssets() public {
function invariantTotalAssets() public view {
assertEq(
ERC4626Extended.totalAssets(),
erc4626VaultHandler.totalAssets()
Expand Down
26 changes: 13 additions & 13 deletions test/governance/TimelockController.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ contract TimelockControllerTest is Test {
IAccessControl accessControl,
bytes32 role,
address[2] storage addresses
) internal {
) internal view {
assertTrue(
!accessControl.hasRole(role, addresses[0]) &&
!accessControl.hasRole(role, addresses[1])
Expand Down Expand Up @@ -616,7 +616,7 @@ contract TimelockControllerTest is Test {
assertEq(timelockControllerAddr.balance, 0.5 ether);
}

function testSupportsInterfaceSuccess() public {
function testSupportsInterfaceSuccess() public view {
assertTrue(
timelockController.supportsInterface(type(IERC165).interfaceId)
);
Expand All @@ -632,7 +632,7 @@ contract TimelockControllerTest is Test {
);
}

function testSupportsInterfaceSuccessGasCost() public {
function testSupportsInterfaceSuccessGasCost() public view {
uint256 startGas = gasleft();
timelockController.supportsInterface(type(IERC165).interfaceId);
uint256 gasUsed = startGas - gasleft();
Expand All @@ -642,11 +642,11 @@ contract TimelockControllerTest is Test {
);
}

function testSupportsInterfaceInvalidInterfaceId() public {
function testSupportsInterfaceInvalidInterfaceId() public view {
assertTrue(!timelockController.supportsInterface(0x0011bbff));
}

function testSupportsInterfaceInvalidInterfaceIdGasCost() public {
function testSupportsInterfaceInvalidInterfaceIdGasCost() public view {
uint256 startGas = gasleft();
timelockController.supportsInterface(0x0011bbff);
uint256 gasUsed = startGas - gasleft();
Expand All @@ -656,7 +656,7 @@ contract TimelockControllerTest is Test {
);
}

function testHashOperation() public {
function testHashOperation() public view {
uint256 amount = 0;
bytes32 slot = bytes32(uint256(1337));
bytes32 value = bytes32(uint256(6699));
Expand Down Expand Up @@ -1899,7 +1899,7 @@ contract TimelockControllerTest is Test {
vm.stopPrank();
}

function testHashOperationBatch() public {
function testHashOperationBatch() public view {
address[] memory targets = new address[](1);
targets[0] = target;
uint256[] memory amounts = new uint256[](1);
Expand Down Expand Up @@ -3308,7 +3308,7 @@ contract TimelockControllerTest is Test {
assertEq(timelockController.get_minimum_delay(), newMinDelay);
}

function testInvalidOperation() public {
function testInvalidOperation() public view {
assertTrue(!timelockController.is_operation(keccak256("Invalid")));
}

Expand Down Expand Up @@ -4033,7 +4033,7 @@ contract TimelockControllerTest is Test {
bytes memory payload,
bytes32 predecessor,
bytes32 salt
) public {
) public view {
bytes32 operationId = timelockController.hash_operation(
target_,
amount,
Expand Down Expand Up @@ -4114,7 +4114,7 @@ contract TimelockControllerTest is Test {
bytes[] memory payloads,
bytes32 predecessor,
bytes32 salt
) public {
) public view {
bytes32 batchedOperationId = timelockController.hash_operation_batch(
targets_,
amounts,
Expand Down Expand Up @@ -4253,7 +4253,7 @@ contract TimelockControllerInvariants is Test {
* @dev The number of scheduled transactions cannot exceed the number of
* executed transactions.
*/
function invariantExecutedLessThanOrEqualToScheduled() public {
function invariantExecutedLessThanOrEqualToScheduled() public view {
assertTrue(
timelockControllerHandler.executeCount() <=
timelockControllerHandler.scheduleCount()
Expand All @@ -4263,7 +4263,7 @@ contract TimelockControllerInvariants is Test {
/**
* @dev The number of proposals executed must match the count number.
*/
function invariantProposalsExecutedMatchCount() public {
function invariantProposalsExecutedMatchCount() public view {
assertEq(
timelockControllerHandler.executeCount(),
timelockControllerHandler.counter()
Expand Down Expand Up @@ -4294,7 +4294,7 @@ contract TimelockControllerInvariants is Test {
* @dev The sum of the executed proposals and the cancelled proposals must
* be less than or equal to the number of scheduled proposals.
*/
function invariantSumOfProposals() public {
function invariantSumOfProposals() public view {
assertTrue(
(timelockControllerHandler.cancelCount() +
timelockControllerHandler.executeCount()) <=
Expand Down
18 changes: 9 additions & 9 deletions test/tokens/ERC1155.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ contract ERC1155Test is Test {
);
}

function testSupportsInterfaceSuccess() public {
function testSupportsInterfaceSuccess() public view {
assertTrue(
ERC1155Extended.supportsInterface(type(IERC165).interfaceId)
);
Expand All @@ -89,7 +89,7 @@ contract ERC1155Test is Test {
);
}

function testSupportsInterfaceSuccessGasCost() public {
function testSupportsInterfaceSuccessGasCost() public view {
uint256 startGas = gasleft();
ERC1155Extended.supportsInterface(type(IERC165).interfaceId);
uint256 gasUsed = startGas - gasleft();
Expand All @@ -99,11 +99,11 @@ contract ERC1155Test is Test {
);
}

function testSupportsInterfaceInvalidInterfaceId() public {
function testSupportsInterfaceInvalidInterfaceId() public view {
assertTrue(!ERC1155Extended.supportsInterface(0x0011bbff));
}

function testSupportsInterfaceInvalidInterfaceIdGasCost() public {
function testSupportsInterfaceInvalidInterfaceIdGasCost() public view {
uint256 startGas = gasleft();
ERC1155Extended.supportsInterface(0x0011bbff);
uint256 gasUsed = startGas - gasleft();
Expand Down Expand Up @@ -1191,7 +1191,7 @@ contract ERC1155Test is Test {
vm.stopPrank();
}

function testUriNoTokenUri() public {
function testUriNoTokenUri() public view {
assertEq(
ERC1155Extended.uri(0),
string.concat(_BASE_URI, Strings.toString(uint256(0)))
Expand Down Expand Up @@ -1271,7 +1271,7 @@ contract ERC1155Test is Test {
ERC1155Extended.set_uri(1, "my_awesome_uri");
}

function testTotalSupplyBeforeMint() public {
function testTotalSupplyBeforeMint() public view {
assertEq(ERC1155Extended.total_supply(0), 0);
}

Expand Down Expand Up @@ -1351,7 +1351,7 @@ contract ERC1155Test is Test {
vm.stopPrank();
}

function testExistsBeforeMint() public {
function testExistsBeforeMint() public view {
assertTrue(!ERC1155Extended.exists(0));
}

Expand Down Expand Up @@ -2381,7 +2381,7 @@ contract ERC1155Test is Test {
ERC1155Extended.set_minter(deployer, false);
}

function testHasOwner() public {
function testHasOwner() public view {
assertEq(ERC1155Extended.owner(), deployer);
}

Expand Down Expand Up @@ -3596,7 +3596,7 @@ contract ERC1155Invariants is Test {
targetSender(deployer);
}

function invariantOwner() public {
function invariantOwner() public view {
assertEq(ERC1155Extended.owner(), erc1155Handler.owner());
}
}
Expand Down
Loading

0 comments on commit 75601b6

Please sign in to comment.