Skip to content

Commit

Permalink
Fail when specifying unsupported versions
Browse files Browse the repository at this point in the history
  • Loading branch information
elfedy committed Jan 17, 2025
1 parent 67861ec commit 01eb12a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/zksync/compilers/src/compilers/zksolc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,18 @@ impl ZkSolc {

/// Get path for installed zksolc version. Returns `Ok(None)` if not installed
pub fn find_installed_version(version: &Version) -> Result<Option<PathBuf>> {
let min_supported_version = Self::zksolc_minimum_supported_version();
let latest_supported_version = Self::zksolc_latest_supported_version();
if *version < min_supported_version {
return Err(SolcError::msg(format!(
"Specifying zksolc v{version} not supported. Minimum version supported is v{min_supported_version}"
)));
}
if *version > latest_supported_version {
return Err(SolcError::msg(format!(
"Specifying zksolc v{version} not supported. Latest version supported is v{latest_supported_version}"
)));
}
let zksolc = Self::compiler_path(version)?;

if !zksolc.is_file() {
Expand Down

0 comments on commit 01eb12a

Please sign in to comment.