-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: updated forge version command to be more resilient
- Loading branch information
1 parent
529ecac
commit df9f90b
Showing
5 changed files
with
90 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.18; | ||
|
||
import {Test, console2} from "forge-std/Test.sol"; | ||
import {FoundryZkSyncChecker} from "src/FoundryZkSyncChecker.sol"; | ||
import {StringUtils} from "src/StringUtils.sol"; | ||
|
||
contract FoundryZkSyncCheckerTest is Test, FoundryZkSyncChecker { | ||
using StringUtils for string; | ||
|
||
string public constant RELATIVE_SCRIPT_PATH = "test/is_foundry_zksync.sh"; | ||
|
||
function setUp() public {} | ||
|
||
function testVersion() public { | ||
bool isZkFoundryBashScript = is_foundry_zksync_bash_script(); | ||
bool isZkFoundryChecker = is_foundry_zksync(); | ||
assertEq(isZkFoundryBashScript, isZkFoundryChecker); | ||
} | ||
|
||
/*////////////////////////////////////////////////////////////// | ||
HELPER | ||
//////////////////////////////////////////////////////////////*/ | ||
function is_foundry_zksync_bash_script() public returns (bool) { | ||
string[] memory command = new string[](2); | ||
command[0] = "bash"; | ||
command[1] = RELATIVE_SCRIPT_PATH; | ||
bytes memory retData = vm.ffi(command); | ||
bool isFoundryZkSync = uint256(bytes32(retData)) > 0; | ||
return isFoundryZkSync; | ||
} | ||
} |
File renamed without changes.