Skip to content

Commit

Permalink
Update substrate/primitives/consensus/slots/src/lib.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Davide Galassi <[email protected]>
  • Loading branch information
LGLO and davxy authored Aug 19, 2024
1 parent 033a616 commit c632df5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion substrate/primitives/consensus/slots/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ impl Slot {
Slot(timestamp.as_millis() / slot_duration.as_millis())
}

/// Timestamp of the start of the slot. Returns None if would overflow for given SlotDuration.
/// Timestamp of the start of the slot.
///
/// Returns `None` if would overflow for given `SlotDuration`.
pub fn timestamp(&self, slot_duration: SlotDuration) -> Option<Timestamp> {
slot_duration.as_millis().checked_mul(self.0).map(Timestamp::new)
}
Expand Down

0 comments on commit c632df5

Please sign in to comment.