diff --git a/crates/format/src/corpus.rs b/crates/format/src/corpus.rs index 602a669..80071b3 100644 --- a/crates/format/src/corpus.rs +++ b/crates/format/src/corpus.rs @@ -35,33 +35,47 @@ impl Corpus { /// /// `path` is expected to be a directory. pub fn collect_metadata(path: &Path, tests: &mut Vec) { - let dir_entry = match std::fs::read_dir(path) { - Ok(dir_entry) => dir_entry, - Err(error) => { - tracing::error!("failed to read dir '{}': {error}", path.display()); - return; - } - }; - - for entry in dir_entry { - let entry = match entry { - Ok(entry) => entry, + if path.is_dir() { + let dir_entry = match std::fs::read_dir(path) { + Ok(dir_entry) => dir_entry, Err(error) => { - tracing::error!("error reading dir entry: {error}"); - continue; + tracing::error!("failed to read dir '{}': {error}", path.display()); + return; } }; - let path = entry.path(); - if path.is_dir() { - collect_metadata(&path, tests); - continue; - } + for entry in dir_entry { + let entry = match entry { + Ok(entry) => entry, + Err(error) => { + tracing::error!("error reading dir entry: {error}"); + continue; + } + }; - if path.is_file() { - if let Some(metadata) = MetadataFile::try_from_file(&path) { + let path = entry.path(); + if path.is_dir() { + collect_metadata(&path, tests); + continue; + } + + if path.is_file() { + if let Some(metadata) = MetadataFile::try_from_file(&path) { + tests.push(metadata) + } + } + } + } else { + let Some(extension) = path.extension() else { + tracing::error!("Failed to get file extension"); + return; + }; + if extension.eq_ignore_ascii_case("sol") || extension.eq_ignore_ascii_case("json") { + if let Some(metadata) = MetadataFile::try_from_file(path) { tests.push(metadata) } + } else { + tracing::error!(?extension, "Unsupported file extension"); } } } diff --git a/crates/node/src/geth.rs b/crates/node/src/geth.rs index 7679171..9795893 100644 --- a/crates/node/src/geth.rs +++ b/crates/node/src/geth.rs @@ -152,6 +152,10 @@ impl Instance { .arg("--nodiscover") .arg("--maxpeers") .arg("0") + .arg("--txlookuplimit") + .arg("0") + .arg("--cache.blocklogs") + .arg("512") .stderr(stderr_logs_file.try_clone()?) .stdout(stdout_logs_file.try_clone()?) .spawn()? @@ -294,7 +298,10 @@ impl EthereumNode for Instance { } match provider.get_transaction_receipt(*transaction_hash).await { - Ok(Some(receipt)) => break Ok(receipt), + Ok(Some(receipt)) => { + tracing::info!(?total_wait_duration, "Found receipt"); + break Ok(receipt); + } Ok(None) => {} Err(error) => { let error_string = error.to_string();