mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
feat: snapshots (#5738)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de> Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com> Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>
This commit is contained in:
@ -83,12 +83,12 @@ impl<DB> ProviderFactory<DB> {
|
||||
mut self,
|
||||
snapshots_path: PathBuf,
|
||||
highest_snapshot_tracker: watch::Receiver<Option<HighestSnapshots>>,
|
||||
) -> Self {
|
||||
) -> ProviderResult<Self> {
|
||||
self.snapshot_provider = Some(Arc::new(
|
||||
SnapshotProvider::new(snapshots_path)
|
||||
SnapshotProvider::new(snapshots_path)?
|
||||
.with_highest_tracker(Some(highest_snapshot_tracker)),
|
||||
));
|
||||
self
|
||||
Ok(self)
|
||||
}
|
||||
|
||||
/// Returns reference to the underlying database.
|
||||
@ -401,6 +401,13 @@ impl<DB: Database> ReceiptProvider for ProviderFactory<DB> {
|
||||
fn receipts_by_block(&self, block: BlockHashOrNumber) -> ProviderResult<Option<Vec<Receipt>>> {
|
||||
self.provider()?.receipts_by_block(block)
|
||||
}
|
||||
|
||||
fn receipts_by_tx_range(
|
||||
&self,
|
||||
range: impl RangeBounds<TxNumber>,
|
||||
) -> ProviderResult<Vec<Receipt>> {
|
||||
self.provider()?.receipts_by_tx_range(range)
|
||||
}
|
||||
}
|
||||
|
||||
impl<DB: Database> WithdrawalsProvider for ProviderFactory<DB> {
|
||||
|
||||
Reference in New Issue
Block a user