cooked-validators-4.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Tweak.ValidityRange

Description

This module defines Tweaks revolving around the validity range of a transaction

Synopsis

Documentation

setValidityRangeTweak :: MonadTweak m => SlotRange -> m SlotRange Source #

Changes the current validity range, returning the old one

setAlwaysValidRangeTweak :: MonadTweak m => m SlotRange Source #

Ensures the skeleton makes for an unconstrained validity range

setValidityStartTweak :: MonadTweak m => Slot -> m SlotRange Source #

Sets the left bound of the validity range. Leaves the right bound unchanged

setValidityEndTweak :: MonadTweak m => Slot -> m SlotRange Source #

Sets the right bound of the validity range. Leaves the left bound unchanged

validityRangeSatisfiesTweak :: MonadTweak m => (SlotRange -> Bool) -> m Bool Source #

Checks if the validity range satisfies a certain predicate

isValidAtTweak :: MonadTweak m => Slot -> m Bool Source #

Checks if a given time belongs to the validity range of a transaction

isValidNowTweak :: MonadTweak m => m Bool Source #

Checks if the current validity range includes the current time

isValidDuringTweak :: MonadTweak m => SlotRange -> m Bool Source #

Checks if a given range is included in the validity range of a transaction

hasEmptyTimeRangeTweak :: MonadTweak m => m Bool Source #

Checks if the validity range is empty

hasFullTimeRangeTweak :: MonadTweak m => m Bool Source #

Checks if the validity range is unconstrained

intersectValidityRangeTweak :: MonadTweak m => SlotRange -> m SlotRange Source #

Adds a constraint to the current validity range. Returns the old range, and fails is the resulting interval is empty

centerAroundValidityRangeTweak :: MonadTweak m => Slot -> Integer -> m SlotRange Source #

Centers the validity range around a value with a certain radius

makeValidityRangeSingletonTweak :: MonadTweak m => Slot -> m SlotRange Source #

Makes a transaction range equal to a singleton

makeValidityRangeNowTweak :: MonadTweak m => m SlotRange Source #

Makes the transaction validity range comply with the current time

waitUntilValidTweak :: MonadTweak m => m Slot Source #

Makes current time comply with the validity range of the transaction under modification. Returns the new current time after the modification; fails if current time is already after the validity range.