Commit 6d779e3d authored by Maurelian's avatar Maurelian Committed by GitHub

feat: Delete unused test mock contracts (#13684)

parent 77ece638
......@@ -19,68 +19,6 @@ contract CallRecorder {
}
}
/// @dev Useful for testing reentrancy guards
contract CallerCaller {
event WhatHappened(bool success, bytes returndata);
fallback() external {
(bool success, bytes memory returndata) = msg.sender.call(msg.data);
emit WhatHappened(success, returndata);
assembly {
switch success
case 0 { revert(add(returndata, 0x20), mload(returndata)) }
default { return(add(returndata, 0x20), mload(returndata)) }
}
}
}
/// @dev Used for testing the `CrossDomainMessenger`'s per-message reentrancy guard.
contract ConfigurableCaller {
bool doRevert = true;
address target;
bytes payload;
event WhatHappened(bool success, bytes returndata);
/// @notice Call the configured target with the configured payload OR revert.
function call() external {
if (doRevert) {
revert("ConfigurableCaller: revert");
} else {
(bool success, bytes memory returndata) = address(target).call(payload);
emit WhatHappened(success, returndata);
assembly {
switch success
case 0 { revert(add(returndata, 0x20), mload(returndata)) }
default { return(add(returndata, 0x20), mload(returndata)) }
}
}
}
/// @notice Set whether or not to have `call` revert.
function setDoRevert(bool _doRevert) external {
doRevert = _doRevert;
}
/// @notice Set the target for the call made in `call`.
function setTarget(address _target) external {
target = _target;
}
/// @notice Set the payload for the call made in `call`.
function setPayload(bytes calldata _payload) external {
payload = _payload;
}
/// @notice Fallback function that reverts if `doRevert` is true.
/// Otherwise, it does nothing.
fallback() external {
if (doRevert) {
revert("ConfigurableCaller: revert");
}
}
}
/// @dev Any call will revert
contract Reverter {
function doRevert() public pure {
......
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