Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions grey/crates/grey-services/src/accumulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,11 @@ pub fn integrate_preimages(
}
}

/// Collect the set of work-package hashes from accumulated reports (P function).
/// Collect the set of work-package hashes from the first `count` reports (P function).
///
/// Delegates to [`grey_state::accumulate::package_hashes`] after truncating to `count`.
pub fn accumulated_package_hashes(reports: &[WorkReport], count: usize) -> BTreeSet<Hash> {
reports
.iter()
.take(count)
.map(|r| r.package_spec.package_hash)
.collect()
grey_state::accumulate::package_hashes(&reports[..count.min(reports.len())])
}

#[cfg(test)]
Expand Down
2 changes: 1 addition & 1 deletion grey/crates/grey-state/src/accumulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ fn partition_reports(reports: &[WorkReport]) -> (Vec<WorkReport>, Vec<ReadyRecor
}

/// Extract work-package hashes from reports (eq 12.9).
fn package_hashes(reports: &[WorkReport]) -> BTreeSet<Hash> {
pub fn package_hashes(reports: &[WorkReport]) -> BTreeSet<Hash> {
reports
.iter()
.map(|r| r.package_spec.package_hash)
Expand Down
Loading