Skip to content
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

SCP-2596: New posixTimeRange <-> SlotRange logic #3665

Merged
merged 5 commits into from
Aug 4, 2021

Conversation

sjoerdvisscher
Copy link
Contributor

@sjoerdvisscher sjoerdvisscher commented Aug 2, 2021

Now posixTimeRangeToContainedSlotRange returns the largest slot range that is entirely contained by the time range, and slotRangeToPOSIXTimeRange takes exclusive bounds into account.

Pre-submit checklist:

  • Branch
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Relevant tickets are mentioned in commit messages
    • Formatting, materialized Nix files, PNG optimization, etc. are updated
  • PR
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

@sjoerdvisscher sjoerdvisscher changed the title New posixTimeRange <-> SlotRange logic SCP-2596: New posixTimeRange <-> SlotRange logic Aug 2, 2021
@michaelpj
Copy link
Contributor

Can we give these things explicit names that make it clear what's happening? e.g. slotRangeWithinPosixTimeRange/posixTimeRangeContainingSlotRange or something? I do think it's misleading having a bare posixTimeRangeToSlotRange that sounds like it's "perfect", when in fact there are a few options.

@michaelpj
Copy link
Contributor

(Feel free to bikeshed on names, I think it's hard to give a good one here...)

plutus-ledger/test/Spec.hs Show resolved Hide resolved
plutus-ledger/src/Ledger/TimeSlot.hs Show resolved Hide resolved
plutus-ledger/src/Ledger/TimeSlot.hs Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants