mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: clean up some errors (#7585)
This commit is contained in:
@ -23,9 +23,6 @@ pub enum ProviderError {
|
||||
/// Error when recovering the sender for a transaction
|
||||
#[error("failed to recover sender for transaction")]
|
||||
SenderRecoveryError,
|
||||
/// Inconsistent header gap.
|
||||
#[error("inconsistent header gap in the database")]
|
||||
InconsistentHeaderGap,
|
||||
/// The header number was not found for the given block hash.
|
||||
#[error("block hash {0} does not exist in Headers table")]
|
||||
BlockHashNotFound(BlockHash),
|
||||
@ -65,9 +62,6 @@ pub enum ProviderError {
|
||||
/// The specific receipt is missing
|
||||
#[error("no receipt found for {0:?}")]
|
||||
ReceiptNotFound(TxHashOrNumber),
|
||||
/// Unable to find a specific block.
|
||||
#[error("block does not exist {0:?}")]
|
||||
BlockNotFound(BlockHashOrNumber),
|
||||
/// Unable to find the best block.
|
||||
#[error("best block does not exist")]
|
||||
BestBlockNotFound,
|
||||
|
||||
@ -476,7 +476,7 @@ where
|
||||
None => self
|
||||
.provider
|
||||
.block_hash(header.number)?
|
||||
.ok_or(ProviderError::BlockNotFound(header.number.into()))?,
|
||||
.ok_or(ProviderError::HeaderNotFound(header.number.into()))?,
|
||||
};
|
||||
|
||||
if let Some(receipts) = self.eth_cache.get_receipts(block_hash).await? {
|
||||
|
||||
@ -166,7 +166,7 @@ impl<EF: ExecutorFactory> ExecutionStage<EF> {
|
||||
// we need the block's transactions but we don't need the transaction hashes
|
||||
let block = provider
|
||||
.block_with_senders(block_number.into(), TransactionVariant::NoHash)?
|
||||
.ok_or_else(|| ProviderError::BlockNotFound(block_number.into()))?;
|
||||
.ok_or_else(|| ProviderError::HeaderNotFound(block_number.into()))?;
|
||||
|
||||
fetch_block_duration += fetch_block_start.elapsed();
|
||||
|
||||
@ -456,7 +456,7 @@ impl<EF: ExecutorFactory, DB: Database> Stage<DB> for ExecutionStage<EF> {
|
||||
for block_number in range {
|
||||
stage_checkpoint.progress.processed -= provider
|
||||
.block_by_number(block_number)?
|
||||
.ok_or_else(|| ProviderError::BlockNotFound(block_number.into()))?
|
||||
.ok_or_else(|| ProviderError::HeaderNotFound(block_number.into()))?
|
||||
.gas_used;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user