Commit 500d4807 authored by Inphi's avatar Inphi Committed by GitHub

ctb: Add disputegame contracts to Spec tests (#10234)

parent 4ff07403
......@@ -146,11 +146,19 @@ library ForgeArtifacts {
/// @notice Returns the function ABIs of all L1 contracts.
function getContractFunctionAbis(
string memory path,
string memory excludes
string[] memory pathExcludes
)
internal
returns (Abi[] memory abis_)
{
string memory pathExcludesPat;
for (uint256 i = 0; i < pathExcludes.length; i++) {
pathExcludesPat = string.concat(pathExcludesPat, " -path ", pathExcludes[i]);
if (i != pathExcludes.length - 1) {
pathExcludesPat = string.concat(pathExcludesPat, " -o ");
}
}
string[] memory command = new string[](3);
command[0] = Executables.bash;
command[1] = "-c";
......@@ -158,8 +166,8 @@ library ForgeArtifacts {
Executables.find,
" ",
path,
bytes(pathExcludesPat).length > 0 ? string.concat(" ! \\( ", pathExcludesPat, " \\)") : "",
" -type f ",
bytes(excludes).length > 0 ? string.concat(" ! -name ", excludes, " ") : "",
"-exec basename {} \\;",
" | ",
Executables.sed,
......
......@@ -241,7 +241,9 @@ contract DeputyGuardianModule_NoPortalCollisions_Test is DeputyGuardianModule_Te
/// @dev tests that no function selectors in the L1 contracts collide with the OptimismPortal2 functions called by
/// the DeputyGuardianModule.
function test_noPortalCollisions_succeeds() external {
Abi[] memory abis = ForgeArtifacts.getContractFunctionAbis("src/{L1,dispute,universal}/", "OptimismPortal2.sol");
string[] memory excludes = new string[](1);
excludes[0] = "src/L1/OptimismPortal2.sol";
Abi[] memory abis = ForgeArtifacts.getContractFunctionAbis("src/{L1,dispute,universal}/", excludes);
for (uint256 i; i < abis.length; i++) {
for (uint256 j; j < abis[i].entries.length; j++) {
bytes4 sel = abis[i].entries[j].sel;
......
This diff is collapsed.
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