mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(tree): remove redundant BlockchainTree RethError variant (#5269)
This commit is contained in:
@ -955,7 +955,9 @@ where
|
|||||||
})
|
})
|
||||||
.with_latest_valid_hash(B256::ZERO)
|
.with_latest_valid_hash(B256::ZERO)
|
||||||
}
|
}
|
||||||
RethError::BlockchainTree(BlockchainTreeError::BlockHashNotFoundInChain { .. }) => {
|
RethError::Canonical(CanonicalError::BlockchainTree(
|
||||||
|
BlockchainTreeError::BlockHashNotFoundInChain { .. },
|
||||||
|
)) => {
|
||||||
// This just means we couldn't find the block when attempting to make it canonical,
|
// This just means we couldn't find the block when attempting to make it canonical,
|
||||||
// so we should not warn the user, since this will result in us attempting to sync
|
// so we should not warn the user, since this will result in us attempting to sync
|
||||||
// to a new target and is considered normal operation during sync
|
// to a new target and is considered normal operation during sync
|
||||||
|
|||||||
@ -330,7 +330,6 @@ impl From<crate::RethError> for InsertBlockErrorKind {
|
|||||||
RethError::Network(err) => InsertBlockErrorKind::Internal(Box::new(err)),
|
RethError::Network(err) => InsertBlockErrorKind::Internal(Box::new(err)),
|
||||||
RethError::Custom(err) => InsertBlockErrorKind::Internal(err.into()),
|
RethError::Custom(err) => InsertBlockErrorKind::Internal(err.into()),
|
||||||
RethError::Canonical(err) => InsertBlockErrorKind::Canonical(err),
|
RethError::Canonical(err) => InsertBlockErrorKind::Canonical(err),
|
||||||
RethError::BlockchainTree(err) => InsertBlockErrorKind::BlockchainTree(err),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,13 +23,16 @@ pub enum RethError {
|
|||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Canonical(#[from] crate::blockchain_tree::error::CanonicalError),
|
Canonical(#[from] crate::blockchain_tree::error::CanonicalError),
|
||||||
|
|
||||||
#[error(transparent)]
|
|
||||||
BlockchainTree(#[from] crate::blockchain_tree::error::BlockchainTreeError),
|
|
||||||
|
|
||||||
#[error("{0}")]
|
#[error("{0}")]
|
||||||
Custom(String),
|
Custom(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<crate::blockchain_tree::error::BlockchainTreeError> for RethError {
|
||||||
|
fn from(error: crate::blockchain_tree::error::BlockchainTreeError) -> Self {
|
||||||
|
RethError::Canonical(error.into())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<reth_nippy_jar::NippyJarError> for RethError {
|
impl From<reth_nippy_jar::NippyJarError> for RethError {
|
||||||
fn from(err: reth_nippy_jar::NippyJarError) -> Self {
|
fn from(err: reth_nippy_jar::NippyJarError) -> Self {
|
||||||
RethError::Custom(err.to_string())
|
RethError::Custom(err.to_string())
|
||||||
|
|||||||
Reference in New Issue
Block a user