I have an issue with Constraints.mustValidateIn
in a StateMachine.
In the case using Interval.to deadline
everything works as expected. But in the case: Interval.from deadline
the constraint is never valid.
I also tried to build the interval by hand to exclude issues with closure: Interval {ivFrom = LowerBound (Finite $ deadline object) False, ivTo = UpperBound PosInf True}
Tried with and without closure but it does not have any effect. Also waiting and use the transition in a slot which is far beyond the deadline does not work.
Docs say :
mustValidateIn :: forall i o. POSIXTimeRange -> TxConstraints i o
*mustValidateIn r requires the transaction's time range to be contained in r.*
If I understand it correct, in this case it means the transaction have to happen between deadline and infinity, which should be represented by the interval above?
I define the deadline in the trace as : slotToEndPOSIXTime def 25
Very confusing is: when I change it to slotToBeginPOSIXTime def 25
without changing anything else the behavior turns around...
Anyway my waitForNSlots in the trace are always minimum 3 slots so it should also not run in some limit case.
The actual distance between slotToBeginPOSIXTime
and slotToEndPOSIXTime
is, if calculated in repl, 999 milliseconds as I would expect with a slot time of 1s.
(Also tried to add / subtract some seconds from the POSIXTime, which had no effect)
Do am I miss something here?
Thank you for support