Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
500d4807
Unverified
Commit
500d4807
authored
Apr 22, 2024
by
Inphi
Committed by
GitHub
Apr 22, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ctb: Add disputegame contracts to Spec tests (#10234)
parent
4ff07403
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
204 additions
and
8 deletions
+204
-8
ForgeArtifacts.sol
packages/contracts-bedrock/scripts/ForgeArtifacts.sol
+10
-2
DeputyGuardianModule.t.sol
...es/contracts-bedrock/test/Safe/DeputyGuardianModule.t.sol
+3
-1
Specs.t.sol
packages/contracts-bedrock/test/Specs.t.sol
+191
-5
No files found.
packages/contracts-bedrock/scripts/ForgeArtifacts.sol
View file @
500d4807
...
@@ -146,11 +146,19 @@ library ForgeArtifacts {
...
@@ -146,11 +146,19 @@ library ForgeArtifacts {
/// @notice Returns the function ABIs of all L1 contracts.
/// @notice Returns the function ABIs of all L1 contracts.
function getContractFunctionAbis(
function getContractFunctionAbis(
string memory path,
string memory path,
string
memory e
xcludes
string
[] memory pathE
xcludes
)
)
internal
internal
returns (Abi[] memory abis_)
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);
string[] memory command = new string[](3);
command[0] = Executables.bash;
command[0] = Executables.bash;
command[1] = "-c";
command[1] = "-c";
...
@@ -158,8 +166,8 @@ library ForgeArtifacts {
...
@@ -158,8 +166,8 @@ library ForgeArtifacts {
Executables.find,
Executables.find,
" ",
" ",
path,
path,
bytes(pathExcludesPat).length > 0 ? string.concat(" ! \\( ", pathExcludesPat, " \\)") : "",
" -type f ",
" -type f ",
bytes(excludes).length > 0 ? string.concat(" ! -name ", excludes, " ") : "",
"-exec basename {} \\;",
"-exec basename {} \\;",
" | ",
" | ",
Executables.sed,
Executables.sed,
...
...
packages/contracts-bedrock/test/Safe/DeputyGuardianModule.t.sol
View file @
500d4807
...
@@ -241,7 +241,9 @@ contract DeputyGuardianModule_NoPortalCollisions_Test is DeputyGuardianModule_Te
...
@@ -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
/// @dev tests that no function selectors in the L1 contracts collide with the OptimismPortal2 functions called by
/// the DeputyGuardianModule.
/// the DeputyGuardianModule.
function test_noPortalCollisions_succeeds() external {
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 i; i < abis.length; i++) {
for (uint256 j; j < abis[i].entries.length; j++) {
for (uint256 j; j < abis[i].entries.length; j++) {
bytes4 sel = abis[i].entries[j].sel;
bytes4 sel = abis[i].entries[j].sel;
...
...
packages/contracts-bedrock/test/Specs.t.sol
View file @
500d4807
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment