mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-06-11 07:21:02 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ca7af278cb |
@@ -54,7 +54,7 @@ pub struct Arguments {
|
|||||||
pub geth: PathBuf,
|
pub geth: PathBuf,
|
||||||
|
|
||||||
/// The maximum time in milliseconds to wait for geth to start.
|
/// The maximum time in milliseconds to wait for geth to start.
|
||||||
#[arg(long = "geth-start-timeout", default_value = "2000")]
|
#[arg(long = "geth-start-timeout", default_value = "5000")]
|
||||||
pub geth_start_timeout: u64,
|
pub geth_start_timeout: u64,
|
||||||
|
|
||||||
/// The test network chain ID.
|
/// The test network chain ID.
|
||||||
|
|||||||
+21
-35
@@ -35,47 +35,33 @@ impl Corpus {
|
|||||||
///
|
///
|
||||||
/// `path` is expected to be a directory.
|
/// `path` is expected to be a directory.
|
||||||
pub fn collect_metadata(path: &Path, tests: &mut Vec<MetadataFile>) {
|
pub fn collect_metadata(path: &Path, tests: &mut Vec<MetadataFile>) {
|
||||||
if path.is_dir() {
|
let dir_entry = match std::fs::read_dir(path) {
|
||||||
let dir_entry = match std::fs::read_dir(path) {
|
Ok(dir_entry) => dir_entry,
|
||||||
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,
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
tracing::error!("failed to read dir '{}': {error}", path.display());
|
tracing::error!("error reading dir entry: {error}");
|
||||||
return;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
for entry in dir_entry {
|
|
||||||
let entry = match entry {
|
|
||||||
Ok(entry) => entry,
|
|
||||||
Err(error) => {
|
|
||||||
tracing::error!("error reading dir entry: {error}");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let path = entry.path();
|
|
||||||
if path.is_dir() {
|
|
||||||
collect_metadata(&path, tests);
|
|
||||||
continue;
|
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) {
|
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)
|
tests.push(metadata)
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
tracing::error!(?extension, "Unsupported file extension");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,10 +152,6 @@ impl Instance {
|
|||||||
.arg("--nodiscover")
|
.arg("--nodiscover")
|
||||||
.arg("--maxpeers")
|
.arg("--maxpeers")
|
||||||
.arg("0")
|
.arg("0")
|
||||||
.arg("--txlookuplimit")
|
|
||||||
.arg("0")
|
|
||||||
.arg("--cache.blocklogs")
|
|
||||||
.arg("512")
|
|
||||||
.stderr(stderr_logs_file.try_clone()?)
|
.stderr(stderr_logs_file.try_clone()?)
|
||||||
.stdout(stdout_logs_file.try_clone()?)
|
.stdout(stdout_logs_file.try_clone()?)
|
||||||
.spawn()?
|
.spawn()?
|
||||||
@@ -298,10 +294,7 @@ impl EthereumNode for Instance {
|
|||||||
}
|
}
|
||||||
|
|
||||||
match provider.get_transaction_receipt(*transaction_hash).await {
|
match provider.get_transaction_receipt(*transaction_hash).await {
|
||||||
Ok(Some(receipt)) => {
|
Ok(Some(receipt)) => break Ok(receipt),
|
||||||
tracing::info!(?total_wait_duration, "Found receipt");
|
|
||||||
break Ok(receipt);
|
|
||||||
}
|
|
||||||
Ok(None) => {}
|
Ok(None) => {}
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
let error_string = error.to_string();
|
let error_string = error.to_string();
|
||||||
|
|||||||
Reference in New Issue
Block a user