refactor(prune): segment trait, receipts impl (#4887)

This commit is contained in:
Alexey Shekhirin
2023-10-05 12:56:47 +01:00
committed by GitHub
parent 4dceabf06b
commit 1e7d028d53
43 changed files with 633 additions and 428 deletions

View File

@ -51,12 +51,12 @@ pub struct SnapshotTargets {
}
impl SnapshotTargets {
/// Returns `true` if any of the data parts has targets, i.e. is [`Some`].
/// Returns `true` if any of the targets are [Some].
pub fn any(&self) -> bool {
self.headers.is_some() || self.receipts.is_some() || self.transactions.is_some()
}
/// Returns `true` if all targets are either [`None`] or multiple of `block_interval`.
/// Returns `true` if all targets are either [None] or multiple of `block_interval`.
fn is_multiple_of_block_interval(&self, block_interval: u64) -> bool {
[
self.headers.as_ref(),