Compare commits

..

1 Commits

Author SHA1 Message Date
activecoder10 a8cde6fa17 deploy contracts 2025-06-12 09:14:05 +03:00
2 changed files with 5 additions and 11 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ clippy:
machete:
cargo install cargo-machete
cargo machete crates
cargo machete
test: format clippy machete
cargo test --workspace -- --nocapture
+4 -10
View File
@@ -132,7 +132,7 @@ impl Metadata {
}
fn try_from_solidity(path: &Path) -> Option<Self> {
let spec = read_to_string(path)
let buf = read_to_string(path)
.inspect_err(|error| {
log::error!(
"opening JSON test metadata file '{}' error: {error}",
@@ -147,24 +147,18 @@ impl Metadata {
buf
});
if spec.is_empty() {
if buf.is_empty() {
return None;
}
match serde_json::from_str::<Self>(&spec) {
match serde_json::from_str::<Self>(&buf) {
Ok(mut metadata) => {
metadata.file_path = Some(path.to_path_buf());
let name = path
.file_name()
.expect("this should be the path to a Solidity file")
.to_str()
.expect("the file name should be valid UTF-8k");
metadata.contracts = Some([(String::from("Test"), format!("{name}:Test"))].into());
Some(metadata)
}
Err(error) => {
log::error!(
"parsing Solidity test metadata file '{}' error: '{error}' from data: {spec}",
"parsing Solidity test metadata file '{}' error: {error}",
path.display()
);
None