fix(engine): fail on canonical errors (#2565)

This commit is contained in:
Roman Krasiuk
2023-05-04 22:49:05 +03:00
committed by GitHub
parent 5605ab2a04
commit 70bcd76032
2 changed files with 14 additions and 0 deletions

View File

@ -63,3 +63,10 @@ pub enum Error {
#[error("Missing total difficulty")]
MissingTotalDifficulty { hash: H256 },
}
impl Error {
/// Returns `true` if the error is fatal.
pub fn is_fatal(&self) -> bool {
matches!(self, Self::CanonicalCommit { .. } | Self::CanonicalRevert { .. })
}
}