Skip to content

Commit

Permalink
debug cwd in evm.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
wischli committed Apr 30, 2024
1 parent 8d38919 commit 88cbc5f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions runtime/integration-tests/src/generic/utils/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,30 @@ fn traversal(path: impl AsRef<Path>, files: &mut Vec<PathBuf>) {
}
}

// TODO(william): Remove
pub fn debug_cwd(cwd: PathBuf) -> std::io::Result<()> {
eprintln!("[evm.rs] Listing contents of: {}", cwd.display());

let entries = fs::read_dir(cwd)?;

for entry in entries {
let entry = entry?;
let path = entry.path();
let metadata = fs::metadata(&path)?;

let type_str = if metadata.is_dir() { "Dir" } else { "File" };
eprintln!("[evm.rs] {}: {}", type_str, path.display());
}

Ok(())
}

pub fn fetch_contracts() -> HashMap<String, ContractInfo> {
let mut contracts = HashMap::new();
let mut files = Vec::new();

debug_cwd(std::env::current_dir().unwrap()).unwrap();

traversal(LP_SOL_SOURCES, &mut files);
files.iter().for_each(|path| {
let file_name = path
Expand Down

0 comments on commit 88cbc5f

Please sign in to comment.