cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Tweak.ValidityRange

Description

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

Synopsis

Documentation

getValidityRangeTweak :: Member Tweak effs => Sem effs SlotRange Source #

Looks up the current validity range of the transaction

setValidityRangeTweak :: Member Tweak effs => SlotRange -> Sem effs SlotRange Source #

Changes the current validity range, returning the old one

setAlwaysValidRangeTweak :: Member Tweak effs => Sem effs SlotRange Source #

Ensures the skeleton makes for an unconstrained validity range

setValidityStartTweak :: Member Tweak effs => Slot -> Sem effs SlotRange Source #

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

setValidityEndTweak :: Member Tweak effs => Slot -> Sem effs SlotRange Source #

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

validityRangeSatisfiesTweak :: Member Tweak effs => (SlotRange -> Bool) -> Sem effs Bool Source #

Checks if the validity range satisfies a certain predicate

isValidAtTweak :: Member Tweak effs => Slot -> Sem effs Bool Source #

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

isValidNowTweak :: Members '[Tweak, MockChainRead] effs => Sem effs Bool Source #

Checks if the current validity range includes the current time

isValidDuringTweak :: Member Tweak effs => SlotRange -> Sem effs Bool Source #

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

hasEmptyTimeRangeTweak :: Member Tweak effs => Sem effs Bool Source #

Checks if the validity range is empty

hasFullTimeRangeTweak :: Member Tweak effs => Sem effs Bool Source #

Checks if the validity range is unconstrained

intersectValidityRangeTweak :: Members '[Tweak, NonDet] effs => SlotRange -> Sem effs SlotRange Source #

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

centerAroundValidityRangeTweak :: Member Tweak effs => Slot -> Integer -> Sem effs SlotRange Source #

Centers the validity range around a value with a certain radius

makeValidityRangeSingletonTweak :: Member Tweak effs => Slot -> Sem effs SlotRange Source #

Makes a transaction range equal to a singleton

makeValidityRangeNowTweak :: Members '[Tweak, MockChainRead] effs => Sem effs SlotRange Source #

Makes the transaction validity range comply with the current time