Commit 1d099302 authored by Maurelian's avatar Maurelian

fix(ctb): Address compiler warnings

fix(ctb): Fix names on fuzz tests
parent af490bbf
...@@ -84,34 +84,34 @@ contract DelayedVetoable is ISemver { ...@@ -84,34 +84,34 @@ contract DelayedVetoable is ISemver {
} }
/// @notice Gets the initiator /// @notice Gets the initiator
/// @return Initiator address. /// @return initiator_ Initiator address.
function initiator() external virtual readOrHandle returns (address) { function initiator() external virtual readOrHandle returns (address initiator_) {
return _initiator; initiator_ = _initiator;
} }
//// @notice Queries the vetoer address. //// @notice Queries the vetoer address.
/// @return Vetoer address. /// @return vetoer_ Vetoer address.
function vetoer() external virtual readOrHandle returns (address) { function vetoer() external virtual readOrHandle returns (address vetoer_) {
return _vetoer; vetoer_ = _vetoer;
} }
//// @notice Queries the target address. //// @notice Queries the target address.
/// @return Target address. /// @return target_ Target address.
function target() external readOrHandle returns (address) { function target() external readOrHandle returns (address target_) {
return _target; target_ = _target;
} }
/// @notice Gets the delay /// @notice Gets the delay
/// @return Delay address. /// @return delay_ Delay address.
function delay() external readOrHandle returns (uint256) { function delay() external readOrHandle returns (uint256 delay_) {
return _delay; delay_ = _delay;
} }
/// @notice Gets entries in the _queuedAt mapping. /// @notice Gets entries in the _queuedAt mapping.
/// @param callHash The hash of the call data. /// @param callHash The hash of the call data.
/// @return The time the callHash was recorded. /// @return queuedAt_ The time the callHash was recorded.
function queuedAt(bytes32 callHash) external readOrHandle returns (uint256) { function queuedAt(bytes32 callHash) external readOrHandle returns (uint256 queuedAt_) {
return _queuedAt[callHash]; queuedAt_ = _queuedAt[callHash];
} }
/// @notice Used for all calls that pass data to the contract. /// @notice Used for all calls that pass data to the contract.
...@@ -139,7 +139,7 @@ contract DelayedVetoable is ISemver { ...@@ -139,7 +139,7 @@ contract DelayedVetoable is ISemver {
if (msg.sender == _initiator && _queuedAt[callHash] == 0) { if (msg.sender == _initiator && _queuedAt[callHash] == 0) {
if (_delay == 0) { if (_delay == 0) {
// This forward function will halt the call frame on completion. // This forward function will halt the call frame on completion.
_forwardAndHalt(callHash, msg.data); _forwardAndHalt(callHash);
} }
_queuedAt[callHash] = block.timestamp; _queuedAt[callHash] = block.timestamp;
emit Initiated(callHash, msg.data); emit Initiated(callHash, msg.data);
...@@ -169,11 +169,11 @@ contract DelayedVetoable is ISemver { ...@@ -169,11 +169,11 @@ contract DelayedVetoable is ISemver {
// Delete the call to prevent replays // Delete the call to prevent replays
delete _queuedAt[callHash]; delete _queuedAt[callHash];
_forwardAndHalt(callHash, msg.data); _forwardAndHalt(callHash);
} }
/// @notice Forwards the call to the target and halts the call frame. /// @notice Forwards the call to the target and halts the call frame.
function _forwardAndHalt(bytes32 callHash, bytes memory data) internal { function _forwardAndHalt(bytes32 callHash) internal {
// Forward the call // Forward the call
emit Forwarded(callHash, msg.data); emit Forwarded(callHash, msg.data);
(bool success,) = _target.call(msg.data); (bool success,) = _target.call(msg.data);
......
...@@ -55,10 +55,8 @@ contract DelayedVetoable_Getters_Test is DelayedVetoable_Init { ...@@ -55,10 +55,8 @@ contract DelayedVetoable_Getters_Test is DelayedVetoable_Init {
} }
contract DelayedVetoable_Getters_TestFail is DelayedVetoable_Init { contract DelayedVetoable_Getters_TestFail is DelayedVetoable_Init {
function test_getters_notVetoer() external { /// @dev Check that getter calls from unauthorized entities will revert.
// getter calls from addresses other than the zero address will revert in the function test_getters_notZeroAddress_reverts() external {
// initiation branch of the proxy.
vm.assume(msg.sender != address(0) && msg.sender != initiator && msg.sender != vetoer);
vm.expectRevert(abi.encodeWithSelector(Unauthorized.selector, initiator, address(this))); vm.expectRevert(abi.encodeWithSelector(Unauthorized.selector, initiator, address(this)));
delayedVetoable.initiator(); delayedVetoable.initiator();
vm.expectRevert(abi.encodeWithSelector(Unauthorized.selector, initiator, address(this))); vm.expectRevert(abi.encodeWithSelector(Unauthorized.selector, initiator, address(this)));
...@@ -126,7 +124,7 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init { ...@@ -126,7 +124,7 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init {
} }
/// @dev The call cannot be forewarded until the delay has passed. /// @dev The call cannot be forewarded until the delay has passed.
function test_handleCall_forwardingTooSoon_reverts(bytes memory data) external { function testFuzz_handleCall_forwardingTooSoon_reverts(bytes memory data) external {
vm.prank(initiator); vm.prank(initiator);
(bool success,) = address(delayedVetoable).call(data); (bool success,) = address(delayedVetoable).call(data);
...@@ -136,7 +134,7 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init { ...@@ -136,7 +134,7 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init {
} }
/// @dev The call cannot be forwarded a second time. /// @dev The call cannot be forwarded a second time.
function test_handleCall_forwardingTwice_reverts(bytes memory data) external { function testFuzz_handleCall_forwardingTwice_reverts(bytes memory data) external {
assumeNonzeroData(data); assumeNonzeroData(data);
// Initiate the call // Initiate the call
...@@ -159,7 +157,7 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init { ...@@ -159,7 +157,7 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init {
} }
/// @dev If the target reverts, it is bubbled up. /// @dev If the target reverts, it is bubbled up.
function test_handleCall_forwardingTargetReverts_reverts(bytes memory data) external { function testFuzz_handleCall_forwardingTargetReverts_reverts(bytes memory data) external {
assumeNonzeroData(data); assumeNonzeroData(data);
vm.etch(target, address(reverter).code); vm.etch(target, address(reverter).code);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment