chore: add some solc checksum traces (#1088)

* chore: add some solc checksum traces

* chore: use qualified path
This commit is contained in:
Matthias Seitz 2022-03-29 01:08:45 +02:00 committed by GitHub
parent 7842a70803
commit 110d1beeed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -394,8 +394,9 @@ impl Solc {
let version = self.version_short()?;
let mut version_path = svm::version_path(version.to_string().as_str());
version_path.push(format!("solc-{}", version.to_string().as_str()));
tracing::trace!(target:"solc", "reading solc binary for checksum {:?}", version_path);
let content =
std::fs::read(&version_path).map_err(|err| SolcError::io(err, version_path))?;
std::fs::read(&version_path).map_err(|err| SolcError::io(err, version_path.clone()))?;
if !RELEASES.2 {
// we skip checksum verification because the underlying request to fetch release info
@ -413,6 +414,7 @@ impl Solc {
if checksum_calc == checksum_found {
Ok(())
} else {
tracing:: warn!(target : "solc", "checksum mismatch for {:?}, expected {}, but found {} for file {:?}", version, hex::encode(&checksum_found), hex::encode(checksum_calc), version_path);
Err(SolcError::ChecksumMismatch)
}
}