Skip to content

Commit

Permalink
Clear PR
Browse files Browse the repository at this point in the history
  • Loading branch information
ferranbt committed Feb 5, 2024
1 parent 7cd156a commit c69f396
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/Test.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,12 @@ contract SuaveEnabled is Test {
ConfidentialInputsWrapperI constant confInputsWrapper = ConfidentialInputsWrapperI(Suave.CONFIDENTIAL_INPUTS);

function setUp() public {
string[] memory inputs = new string[](3);
string[] memory inputs = new string[](2);
inputs[0] = "suave-geth";
inputs[1] = "forge";
inputs[2] = "status";

try vm.ffi(inputs) returns (bytes memory response) {
/*
// the status call of the `suave-geth forge` command fails with the 'not-ok' prefix
// which is '6e6f742d6f6b' in hex
if (isPrefix(hex"6e6f742d6f6b", response)) {
revert("Local Suave node not detected running");
}
*/
} catch (bytes memory reason) {

try vm.ffi(inputs) returns (bytes memory response) {}
catch (bytes memory reason) {
revert(detectErrorMessage(reason));
}

Expand All @@ -44,7 +36,7 @@ contract SuaveEnabled is Test {

function detectErrorMessage(bytes memory reason) internal pure returns (string memory) {
// Errors from cheatcodes are reported as 'CheatcodeError(string)' events
// 'eeaa9e6f' is the signature of the event
// 'eeaa9e6f' is the signature of the event. If the error is not a CheatcodeError, return the reason as is
if (!isPrefix(hex"eeaa9e6f", reason)) {
return string(reason);
}
Expand Down

0 comments on commit c69f396

Please sign in to comment.