chore(solc): improve checksum error message (#1394)
This commit is contained in:
parent
e262e5d758
commit
d09845e0c5
|
@ -457,8 +457,10 @@ 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)
|
||||
let expected = hex::encode(&checksum_found);
|
||||
let detected = hex::encode(checksum_calc);
|
||||
tracing:: warn!(target : "solc", "checksum mismatch for {:?}, expected {}, but found {} for file {:?}", version, expected, detected, version_path);
|
||||
Err(SolcError::ChecksumMismatch { version, expected, detected, file: version_path })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
use semver::Version;
|
||||
use std::{io, path::PathBuf};
|
||||
use thiserror::Error;
|
||||
|
||||
|
@ -13,8 +14,8 @@ pub enum SolcError {
|
|||
PragmaNotFound,
|
||||
#[error("Could not find solc version locally or upstream")]
|
||||
VersionNotFound,
|
||||
#[error("Checksum mismatch")]
|
||||
ChecksumMismatch,
|
||||
#[error("Checksum mismatch for {file}: expected {expected} found {detected} for {version}")]
|
||||
ChecksumMismatch { version: Version, expected: String, detected: String, file: PathBuf },
|
||||
#[error(transparent)]
|
||||
SemverError(#[from] semver::Error),
|
||||
/// Deserialization error
|
||||
|
|
Loading…
Reference in New Issue