-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UTC Time to slots conversion function #5130
Conversation
d3bf90c
to
5a7f583
Compare
5a7f583
to
5b6fd2f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Update the changelog and tidy the commits 👍
I think this can be one commit, or two commits: one for api changes and one for cli changes. |
19a85b5
to
55b14d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 👍
@@ -1422,6 +1424,41 @@ toTentativeEpochInfo (EraHistory _ interpreter) = | |||
$ hoistEpochInfo (first (Text.pack . show) . runExcept) | |||
$ Consensus.interpreterToEpochInfo (Consensus.unsafeExtendSafeZone interpreter) | |||
|
|||
|
|||
-- | Get slot number for timestamp, or an error if the UTC timestamp is before 'SystemStart' or after N+1 era |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
N being the current era right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this function should work for current and next eras.
Description
This is a part of #4928 . This changeset introduces a conversion function: UTC time -> slot number.
The function was tested in #5142
Checklist
See Runnings tests for more details
CHANGELOG.md
for affected package.cabal
files are updatedhlint
. See.github/workflows/check-hlint.yml
for to get thehlint
versionstylish-haskell
. See.github/workflows/stylish-haskell.yml
for to get thestylish-haskell
version