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: machete:
cargo install cargo-machete cargo install cargo-machete
cargo machete crates cargo machete
test: format clippy machete test: format clippy machete
cargo test --workspace -- --nocapture cargo test --workspace -- --nocapture
+4 -10
View File
@@ -132,7 +132,7 @@ impl Metadata {
} }
fn try_from_solidity(path: &Path) -> Option<Self> { fn try_from_solidity(path: &Path) -> Option<Self> {
let spec = read_to_string(path) let buf = read_to_string(path)
.inspect_err(|error| { .inspect_err(|error| {
log::error!( log::error!(
"opening JSON test metadata file '{}' error: {error}", "opening JSON test metadata file '{}' error: {error}",
@@ -147,24 +147,18 @@ impl Metadata {
buf buf
}); });
if spec.is_empty() { if buf.is_empty() {
return None; return None;
} }
match serde_json::from_str::<Self>(&spec) { match serde_json::from_str::<Self>(&buf) {
Ok(mut metadata) => { Ok(mut metadata) => {
metadata.file_path = Some(path.to_path_buf()); 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) Some(metadata)
} }
Err(error) => { Err(error) => {
log::error!( log::error!(
"parsing Solidity test metadata file '{}' error: '{error}' from data: {spec}", "parsing Solidity test metadata file '{}' error: {error}",
path.display() path.display()
); );
None None