mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(provider): migrate providers to ProviderError (#5473)
This commit is contained in:
@ -22,7 +22,7 @@ pub use transactions::Transactions;
|
||||
|
||||
use crate::PrunerError;
|
||||
use reth_db::database::Database;
|
||||
use reth_interfaces::RethResult;
|
||||
use reth_interfaces::{provider::ProviderResult, RethResult};
|
||||
use reth_primitives::{BlockNumber, PruneCheckpoint, PruneMode, PruneSegment, TxNumber};
|
||||
use reth_provider::{BlockReader, DatabaseProviderRW, PruneCheckpointWriter};
|
||||
use std::ops::RangeInclusive;
|
||||
@ -54,7 +54,7 @@ pub trait Segment<DB: Database>: Debug + Send + Sync {
|
||||
&self,
|
||||
provider: &DatabaseProviderRW<'_, DB>,
|
||||
checkpoint: PruneCheckpoint,
|
||||
) -> RethResult<()> {
|
||||
) -> ProviderResult<()> {
|
||||
provider.save_prune_checkpoint(self.segment(), checkpoint)
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ use crate::{
|
||||
PrunerError,
|
||||
};
|
||||
use reth_db::{database::Database, tables};
|
||||
use reth_interfaces::RethResult;
|
||||
use reth_interfaces::provider::ProviderResult;
|
||||
use reth_primitives::{PruneCheckpoint, PruneMode, PruneSegment};
|
||||
use reth_provider::{DatabaseProviderRW, PruneCheckpointWriter, TransactionsProvider};
|
||||
use tracing::{instrument, trace};
|
||||
@ -73,7 +73,7 @@ impl<DB: Database> Segment<DB> for Receipts {
|
||||
&self,
|
||||
provider: &DatabaseProviderRW<'_, DB>,
|
||||
checkpoint: PruneCheckpoint,
|
||||
) -> RethResult<()> {
|
||||
) -> ProviderResult<()> {
|
||||
provider.save_prune_checkpoint(PruneSegment::Receipts, checkpoint)?;
|
||||
|
||||
// `PruneSegment::Receipts` overrides `PruneSegment::ContractLogs`, so we can preemptively
|
||||
|
||||
Reference in New Issue
Block a user