Skip to content
Unverified Commit 9374643b authored by Lech Głowiak's avatar Lech Głowiak Committed by GitHub
Browse files

Add an utility function to get the first timestamp of a slot (#5316)



# Description

Add `starting_timestamp` function for `Slot` type.

## Integration

This is an addition of public function to a type, so integration should
be seamless for idiomatic use of Rust.

## Review Notes

Since `Slot` is just a slot number, the it's starting timestamp depends
on `SlotDuration` which is a parameter to the added function. This
function can be seen as dual to existing `fn from_timestamp`.
Because there is a potential for overflow, the return type is `Option`.

Q1: should I introduce tests for in this crate and add cases for both
case: overflow (`None`) and no overflow (`Some`)?

Q2: How can I add labels? IMO they should be `T0-node` and `D0-easy` but
I cannot add them using GH interface.

# Checklist

* [x] My PR includes a detailed description as outlined in the
"Description" and its two subsections above.
* [ ] My PR follows the [labeling requirements](CONTRIBUTING.md#Process)
of this project (at minimum one label for `T`
  required)
* External contributors: ask maintainers to put the right label on your
PR.
* [ ] I have made corresponding changes to the documentation (if
applicable)
* [ ] I have added tests that prove my fix is effective or that my
feature works (if applicable)

---------

Co-authored-by: default avatarSquirrel <[email protected]>
Co-authored-by: default avatarDavide Galassi <[email protected]>
parent a67d6232
Pipeline #493797 waiting for manual action with stages
in 48 minutes and 51 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment