Skip to content

Commit

Permalink
Test supressed errors/warnings api
Browse files Browse the repository at this point in the history
  • Loading branch information
elfedy committed Oct 28, 2024
1 parent cec7310 commit b04a920
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
13 changes: 8 additions & 5 deletions crates/compilers/src/compilers/zksolc/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ZkSolcWarning>,
#[serde(default, skip_serializing_if = "HashSet::is_empty")]
pub suppressed_errors: HashSet<ZkSolcError>,
*/
}

/// Default `language` field is set to `"Solidity"`.
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions crates/compilers/src/compilers/zksolc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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("<PATH_TO_RELEASE>").unwrap();
Self { zksolc, solc: Default::default() }
}
}
Expand Down

0 comments on commit b04a920

Please sign in to comment.