Commit af9ee1c1 authored by Mark Tyneway's avatar Mark Tyneway

contracts-bedrock: fix compiler warnings

Fix the compiler warnings in the `DelayedVetoable` tests.
There were unused variables returned from low level calls.
There are alternative compiler warning if there is no
assignment to the variables, so the solution is to use them
either in an assertion or just reference them on their own line.
Silly compiler.
parent e24c4041
...@@ -47,8 +47,8 @@ CrossDomainOwnableThroughPortal_Test:test_depositTransaction_crossDomainOwner_su ...@@ -47,8 +47,8 @@ CrossDomainOwnableThroughPortal_Test:test_depositTransaction_crossDomainOwner_su
CrossDomainOwnable_Test:test_onlyOwner_notOwner_reverts() (gas: 10597) CrossDomainOwnable_Test:test_onlyOwner_notOwner_reverts() (gas: 10597)
CrossDomainOwnable_Test:test_onlyOwner_succeeds() (gas: 34883) CrossDomainOwnable_Test:test_onlyOwner_succeeds() (gas: 34883)
DelayedVetoable_Getters_Test:test_getters() (gas: 24466) DelayedVetoable_Getters_Test:test_getters() (gas: 24466)
DelayedVetoable_Getters_TestFail:test_getters_notZeroAddress_reverts() (gas: 31166) DelayedVetoable_Getters_TestFail:test_getters_notZeroAddress_reverts() (gas: 31206)
DelayedVetoable_HandleCall_TestFail:test_handleCall_unauthorizedInitiation_reverts() (gas: 20234) DelayedVetoable_HandleCall_TestFail:test_handleCall_unauthorizedInitiation_reverts() (gas: 20291)
DeleteOutput:test_script_succeeds() (gas: 3100) DeleteOutput:test_script_succeeds() (gas: 3100)
DeployerWhitelist_Test:test_owner_succeeds() (gas: 7582) DeployerWhitelist_Test:test_owner_succeeds() (gas: 7582)
DeployerWhitelist_Test:test_storageSlots_succeeds() (gas: 33395) DeployerWhitelist_Test:test_storageSlots_succeeds() (gas: 33395)
......
...@@ -32,6 +32,7 @@ contract DelayedVetoable_Init is CommonTest { ...@@ -32,6 +32,7 @@ contract DelayedVetoable_Init is CommonTest {
// value in storage. // value in storage.
vm.prank(initiator); vm.prank(initiator);
(bool success,) = address(delayedVetoable).call(hex""); (bool success,) = address(delayedVetoable).call(hex"");
assertTrue(success);
} }
/// @dev This function is used to prevent initiating the delay unintentionally. /// @dev This function is used to prevent initiating the delay unintentionally.
...@@ -146,6 +147,7 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init { ...@@ -146,6 +147,7 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init {
function test_handleCall_unauthorizedInitiation_reverts() external { function test_handleCall_unauthorizedInitiation_reverts() external {
vm.expectRevert(abi.encodeWithSelector(Unauthorized.selector, initiator, address(this))); vm.expectRevert(abi.encodeWithSelector(Unauthorized.selector, initiator, address(this)));
(bool success,) = address(delayedVetoable).call(NON_ZERO_DATA); (bool success,) = address(delayedVetoable).call(NON_ZERO_DATA);
assertTrue(success);
} }
/// @dev The call cannot be forwarded until the delay has passed. /// @dev The call cannot be forwarded until the delay has passed.
...@@ -156,6 +158,7 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init { ...@@ -156,6 +158,7 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init {
vm.expectRevert(abi.encodeWithSelector(ForwardingEarly.selector)); vm.expectRevert(abi.encodeWithSelector(ForwardingEarly.selector));
(success,) = address(delayedVetoable).call(data); (success,) = address(delayedVetoable).call(data);
success;
} }
/// @dev The call cannot be forwarded a second time. /// @dev The call cannot be forwarded a second time.
...@@ -165,6 +168,7 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init { ...@@ -165,6 +168,7 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init {
// Initiate the call // Initiate the call
vm.prank(initiator); vm.prank(initiator);
(bool success,) = address(delayedVetoable).call(data); (bool success,) = address(delayedVetoable).call(data);
assertTrue(success);
vm.warp(block.timestamp + operatingDelay); vm.warp(block.timestamp + operatingDelay);
vm.expectEmit(true, false, false, true, address(delayedVetoable)); vm.expectEmit(true, false, false, true, address(delayedVetoable));
...@@ -193,6 +197,7 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init { ...@@ -193,6 +197,7 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init {
// Initiate the call // Initiate the call
vm.prank(initiator); vm.prank(initiator);
(bool success,) = address(delayedVetoable).call(inData); (bool success,) = address(delayedVetoable).call(inData);
success;
vm.warp(block.timestamp + operatingDelay); vm.warp(block.timestamp + operatingDelay);
vm.expectEmit(true, false, false, true, address(delayedVetoable)); vm.expectEmit(true, false, false, true, address(delayedVetoable));
...@@ -203,6 +208,7 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init { ...@@ -203,6 +208,7 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init {
// Forward the call // Forward the call
vm.expectRevert(outData); vm.expectRevert(outData);
(bool success2,) = address(delayedVetoable).call(inData); (bool success2,) = address(delayedVetoable).call(inData);
success2;
} }
/// @dev A test documenting the single instance in which the contract is not 'transparent' to the initiator. /// @dev A test documenting the single instance in which the contract is not 'transparent' to the initiator.
...@@ -217,5 +223,6 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init { ...@@ -217,5 +223,6 @@ contract DelayedVetoable_HandleCall_TestFail is DelayedVetoable_Init {
vm.prank(initiator); vm.prank(initiator);
vm.expectRevert(outData); vm.expectRevert(outData);
(bool success,) = address(delayedVetoable).call(inData); (bool success,) = address(delayedVetoable).call(inData);
success;
} }
} }
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