chore: rm reth error variant (#8440)

This commit is contained in:
Matthias Seitz
2024-05-28 19:05:47 +02:00
committed by GitHub
parent 3e7f1377ed
commit 409c15dde4
3 changed files with 10 additions and 16 deletions

View File

@ -4,6 +4,7 @@ use reth_primitives::PruneSegmentError;
use reth_provider::ProviderError;
use thiserror::Error;
/// Errors that can occur during pruning.
#[derive(Error, Debug)]
pub enum PrunerError {
#[error(transparent)]
@ -12,9 +13,6 @@ pub enum PrunerError {
#[error("inconsistent data: {0}")]
InconsistentData(&'static str),
#[error(transparent)]
Interface(#[from] RethError),
#[error(transparent)]
Database(#[from] DatabaseError),
@ -28,7 +26,6 @@ impl From<PrunerError> for RethError {
PrunerError::PruneSegment(_) | PrunerError::InconsistentData(_) => {
RethError::other(err)
}
PrunerError::Interface(err) => err,
PrunerError::Database(err) => RethError::Database(err),
PrunerError::Provider(err) => RethError::Provider(err),
}

View File

@ -9,27 +9,25 @@ mod storage_history;
mod transaction_lookup;
mod transactions;
use crate::PrunerError;
pub use account_history::AccountHistory;
pub use headers::Headers;
pub use receipts::Receipts;
pub use receipts_by_logs::ReceiptsByLogs;
pub use sender_recovery::SenderRecovery;
pub use set::SegmentSet;
use std::fmt::Debug;
pub use storage_history::StorageHistory;
pub use transaction_lookup::TransactionLookup;
pub use transactions::Transactions;
use crate::PrunerError;
use reth_db::database::Database;
use reth_interfaces::{provider::ProviderResult, RethResult};
use reth_interfaces::provider::ProviderResult;
use reth_primitives::{
BlockNumber, PruneCheckpoint, PruneInterruptReason, PruneLimiter, PruneMode, PruneProgress,
PruneSegment, TxNumber,
};
use reth_provider::{BlockReader, DatabaseProviderRW, PruneCheckpointWriter};
use std::ops::RangeInclusive;
pub use sender_recovery::SenderRecovery;
pub use set::SegmentSet;
use std::{fmt::Debug, ops::RangeInclusive};
pub use storage_history::StorageHistory;
use tracing::error;
pub use transaction_lookup::TransactionLookup;
pub use transactions::Transactions;
/// A segment represents a pruning of some portion of the data.
///
@ -85,7 +83,7 @@ impl PruneInput {
pub(crate) fn get_next_tx_num_range<DB: Database>(
&self,
provider: &DatabaseProviderRW<DB>,
) -> RethResult<Option<RangeInclusive<TxNumber>>> {
) -> ProviderResult<Option<RangeInclusive<TxNumber>>> {
let from_tx_number = self.previous_checkpoint
// Checkpoint exists, prune from the next transaction after the highest pruned one
.and_then(|checkpoint| match checkpoint.tx_number {