mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: remove more redundant BlockExecutionError variants (#9905)
This commit is contained in:
@ -291,8 +291,6 @@ impl InsertBlockErrorKind {
|
|||||||
// these are internal errors, not caused by an invalid block
|
// these are internal errors, not caused by an invalid block
|
||||||
BlockExecutionError::LatestBlock(_) |
|
BlockExecutionError::LatestBlock(_) |
|
||||||
BlockExecutionError::Pruning(_) |
|
BlockExecutionError::Pruning(_) |
|
||||||
BlockExecutionError::CanonicalRevert { .. } |
|
|
||||||
BlockExecutionError::CanonicalCommit { .. } |
|
|
||||||
BlockExecutionError::AppendChainDoesntConnect { .. } |
|
BlockExecutionError::AppendChainDoesntConnect { .. } |
|
||||||
BlockExecutionError::Other(_) => false,
|
BlockExecutionError::Other(_) => false,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -125,18 +125,6 @@ pub enum BlockExecutionError {
|
|||||||
/// Consensus error, transparently wrapping `ConsensusError`
|
/// Consensus error, transparently wrapping `ConsensusError`
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Consensus(#[from] ConsensusError),
|
Consensus(#[from] ConsensusError),
|
||||||
/// Transaction error on revert with inner details
|
|
||||||
#[error("transaction error on revert: {inner}")]
|
|
||||||
CanonicalRevert {
|
|
||||||
/// The inner error message
|
|
||||||
inner: String,
|
|
||||||
},
|
|
||||||
/// Transaction error on commit with inner details
|
|
||||||
#[error("transaction error on commit: {inner}")]
|
|
||||||
CanonicalCommit {
|
|
||||||
/// The inner error message.
|
|
||||||
inner: String,
|
|
||||||
},
|
|
||||||
/// Error when appending chain on fork is not possible
|
/// Error when appending chain on fork is not possible
|
||||||
#[error(
|
#[error(
|
||||||
"appending chain on fork (other_chain_fork:?) is not possible as the tip is {chain_tip:?}"
|
"appending chain on fork (other_chain_fork:?) is not possible as the tip is {chain_tip:?}"
|
||||||
@ -180,13 +168,6 @@ impl BlockExecutionError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns `true` if the error is fatal.
|
|
||||||
///
|
|
||||||
/// This represents an unrecoverable database related error.
|
|
||||||
pub const fn is_fatal(&self) -> bool {
|
|
||||||
matches!(self, Self::CanonicalCommit { .. } | Self::CanonicalRevert { .. })
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns `true` if the error is a state root error.
|
/// Returns `true` if the error is a state root error.
|
||||||
pub const fn is_state_root_error(&self) -> bool {
|
pub const fn is_state_root_error(&self) -> bool {
|
||||||
matches!(self, Self::Validation(BlockValidationError::StateRoot(_)))
|
matches!(self, Self::Validation(BlockValidationError::StateRoot(_)))
|
||||||
|
|||||||
Reference in New Issue
Block a user