Skip to content

Commit

Permalink
discard non solidity folders (#1876)
Browse files Browse the repository at this point in the history
  • Loading branch information
lemunozm authored Jun 17, 2024
1 parent 3b6a8c9 commit 4363f8b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion runtime/integration-tests/src/generic/utils/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ impl ContractInfo {
}
}

fn is_sol_directory(dir_entry: &std::fs::DirEntry) -> bool {
dir_entry
.path()
.parent()
.expect(ESSENTIAL)
.extension()
.map(|s| s.to_str().expect(ESSENTIAL))
== Some("sol")
}

fn traversal(path: impl AsRef<Path>, files: &mut Vec<PathBuf>) {
for path in fs::read_dir(path).expect("Submodules directory must exist for integration-tests") {
if let Ok(dir_entry) = path.as_ref() {
Expand All @@ -77,7 +87,9 @@ fn traversal(path: impl AsRef<Path>, files: &mut Vec<PathBuf>) {
.map(|meta| meta.is_file())
.unwrap_or(false)
{
files.push(dir_entry.path())
if is_sol_directory(dir_entry) {
files.push(dir_entry.path())
}
}
}
}
Expand Down

0 comments on commit 4363f8b

Please sign in to comment.