Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
fix: skip checksums for old windows solc (#2554)
Browse files Browse the repository at this point in the history
* fix: skip checksums for old windows solc

* wording
  • Loading branch information
mattsse authored Aug 13, 2023
1 parent 8e50e43 commit 842fe1b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ethers-solc/src/compile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,6 @@ impl Solc {
/// Verify that the checksum for this version of solc is correct. We check against the SHA256
/// checksum from the build information published by [binaries.soliditylang.org](https://binaries.soliditylang.org/)
#[cfg(all(feature = "svm-solc", not(target_arch = "wasm32")))]
#[cfg_attr(windows, allow(unreachable_code, unused_variables))]
pub fn verify_checksum(&self) -> Result<()> {
let version = self.version_short()?;
let mut version_path = svm::version_path(version.to_string().as_str());
Expand All @@ -481,9 +480,12 @@ impl Solc {

#[cfg(windows)]
{
// we skip checksum verification on windows because the expected checksum is for the
// entire zip file and not the extracted solc binary TODO: <https://github.com/alloy-rs/svm-rs/issues/95>
return Ok(())
// Prior to 0.7.2, binaries are released as exe files which are hard to verify: <https://github.com/foundry-rs/foundry/issues/5601>
// <https://binaries.soliditylang.org/windows-amd64/list.json>
const V0_7_2: Version = Version::new(0, 7, 2);
if version < V0_7_2 {
return Ok(())
}
}

use sha2::Digest;
Expand Down

0 comments on commit 842fe1b

Please sign in to comment.