From b04a92034e978a1626fd81b2a9fdc335f42e38e8 Mon Sep 17 00:00:00 2001 From: elfedy Date: Mon, 28 Oct 2024 09:43:35 -0300 Subject: [PATCH] Test supressed errors/warnings api --- crates/compilers/src/compilers/zksolc/input.rs | 13 ++++++++----- crates/compilers/src/compilers/zksolc/mod.rs | 5 +++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/crates/compilers/src/compilers/zksolc/input.rs b/crates/compilers/src/compilers/zksolc/input.rs index 7e570622..733d4576 100644 --- a/crates/compilers/src/compilers/zksolc/input.rs +++ b/crates/compilers/src/compilers/zksolc/input.rs @@ -75,10 +75,12 @@ pub struct ZkSolcInput { pub language: SolcLanguage, pub sources: Sources, pub settings: ZkSettings, + /* #[serde(default, skip_serializing_if = "HashSet::is_empty")] pub suppressed_warnings: HashSet, #[serde(default, skip_serializing_if = "HashSet::is_empty")] pub suppressed_errors: HashSet, + */ } /// Default `language` field is set to `"Solidity"`. @@ -88,17 +90,18 @@ impl Default for ZkSolcInput { language: SolcLanguage::Solidity, sources: Sources::default(), settings: ZkSettings::default(), - suppressed_warnings: HashSet::default(), - suppressed_errors: HashSet::default(), + // suppressed_warnings: HashSet::default(), + // suppressed_errors: HashSet::default(), } } } impl ZkSolcInput { fn new(language: SolcLanguage, sources: Sources, mut settings: ZkSettings) -> Self { - let suppressed_warnings = mem::take(&mut settings.suppressed_warnings); - let suppressed_errors = mem::take(&mut settings.suppressed_errors); - Self { language, sources, settings, suppressed_warnings, suppressed_errors } + // let suppressed_warnings = mem::take(&mut settings.suppressed_warnings); + // let suppressed_errors = mem::take(&mut settings.suppressed_errors); + //Self { language, sources, settings, suppressed_warnings, suppressed_errors } + Self { language, sources, settings } } /// Removes the `base` path from all source files diff --git a/crates/compilers/src/compilers/zksolc/mod.rs b/crates/compilers/src/compilers/zksolc/mod.rs index 1ea4df71..3725730f 100644 --- a/crates/compilers/src/compilers/zksolc/mod.rs +++ b/crates/compilers/src/compilers/zksolc/mod.rs @@ -90,8 +90,9 @@ pub struct ZkSolcCompiler { #[cfg(feature = "project-util")] impl Default for ZkSolcCompiler { fn default() -> Self { - let zksolc = - ZkSolc::get_path_for_version(&ZKSOLC_VERSION).expect("Could not install zksolc"); + // let zksolc = + // ZkSolc::get_path_for_version(&ZKSOLC_VERSION).expect("Could not install zksolc"); + let zksolc = PathBuf::from_str("").unwrap(); Self { zksolc, solc: Default::default() } } }