fedimint_client::oplog

Function rev_epoch_ranges

Source
fn rev_epoch_ranges(
    start_after: ChronologicalOperationLogKey,
    last_entry: ChronologicalOperationLogKey,
    epoch_duration: Duration,
) -> impl Iterator<Item = Range<ChronologicalOperationLogKey>>
Expand description

Returns an iterator over the ranges of operation log keys, starting from the most recent range and going backwards in time till slightly later than last_entry.

Simplifying keys to integers and assuming a start_after of 100, a last_entry of 55 and an epoch_duration of 10 the ranges would be:

[90..100, 80..90, 70..80, 60..70, 50..60]