@@ -19,68 +19,6 @@ contract CallRecorder {
1919 }
2020}
2121
22- /// @dev Useful for testing reentrancy guards
23- contract CallerCaller {
24- event WhatHappened (bool success , bytes returndata );
25-
26- fallback () external {
27- (bool success , bytes memory returndata ) = msg .sender .call (msg .data );
28- emit WhatHappened (success, returndata);
29- assembly {
30- switch success
31- case 0 { revert (add (returndata, 0x20 ), mload (returndata)) }
32- default { return (add (returndata, 0x20 ), mload (returndata)) }
33- }
34- }
35- }
36-
37- /// @dev Used for testing the `CrossDomainMessenger`'s per-message reentrancy guard.
38- contract ConfigurableCaller {
39- bool doRevert = true ;
40- address target;
41- bytes payload;
42-
43- event WhatHappened (bool success , bytes returndata );
44-
45- /// @notice Call the configured target with the configured payload OR revert.
46- function call () external {
47- if (doRevert) {
48- revert ("ConfigurableCaller: revert " );
49- } else {
50- (bool success , bytes memory returndata ) = address (target).call (payload);
51- emit WhatHappened (success, returndata);
52- assembly {
53- switch success
54- case 0 { revert (add (returndata, 0x20 ), mload (returndata)) }
55- default { return (add (returndata, 0x20 ), mload (returndata)) }
56- }
57- }
58- }
59-
60- /// @notice Set whether or not to have `call` revert.
61- function setDoRevert (bool _doRevert ) external {
62- doRevert = _doRevert;
63- }
64-
65- /// @notice Set the target for the call made in `call`.
66- function setTarget (address _target ) external {
67- target = _target;
68- }
69-
70- /// @notice Set the payload for the call made in `call`.
71- function setPayload (bytes calldata _payload ) external {
72- payload = _payload;
73- }
74-
75- /// @notice Fallback function that reverts if `doRevert` is true.
76- /// Otherwise, it does nothing.
77- fallback () external {
78- if (doRevert) {
79- revert ("ConfigurableCaller: revert " );
80- }
81- }
82- }
83-
8422/// @dev Any call will revert
8523contract Reverter {
8624 function doRevert () public pure {
0 commit comments