Skip to content

Avoid branching on "translateUpperBoundForPlutusScripts" protocol version #5126

@lehins

Description

@lehins

It will provide more clarity and code readability if we reimplement transValidityInterval for Conway with new translation and old translation for pre-Conway eras:

transValidityInterval _ protVer epochInfo systemStart = \case
ValidityInterval SNothing SNothing -> pure PV1.always
ValidityInterval (SJust i) SNothing -> PV1.from <$> transSlotToPOSIXTime i
ValidityInterval SNothing (SJust i) -> do
t <- transSlotToPOSIXTime i
pure $
if HardForks.translateUpperBoundForPlutusScripts protVer
then
PV1.Interval
(PV1.LowerBound PV1.NegInf True)
(PV1.strictUpperBound t)
else PV1.to t

This would effectively remove the need for standalone translateUpperBoundForPlutusScripts function

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions