cardano-node-emulator-1.2.0.0
Safe Haskell None
Language Haskell2010

Cardano.Node.Emulator.TimeSlot

Synopsis

Documentation

data SlotConfig Source #

Datatype to configure the length (ms) of one slot and the beginning of the first slot.

Constructors

SlotConfig

Fields

Instances

Instances details
Eq SlotConfig Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

Show SlotConfig Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

Generic SlotConfig Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

ToJSON SlotConfig Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

FromJSON SlotConfig Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

Default SlotConfig Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

Pretty SlotConfig Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

Serialise SlotConfig Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

Lift DefaultUni SlotConfig Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

Typeable DefaultUni SlotConfig Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

type Rep SlotConfig Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

type Rep SlotConfig = D1 (' MetaData "SlotConfig" "Cardano.Node.Emulator.TimeSlot" "cardano-node-emulator-1.2.0.0-AoNv3krP7ndKjYjVelWOdO" ' False ) ( C1 (' MetaCons "SlotConfig" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "scSlotLength") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Integer ) :*: S1 (' MetaSel (' Just "scSlotZeroTime") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 POSIXTime )))

data SlotConversionError Source #

Constructors

SlotOutOfRange

Fields

Instances

Instances details
Eq SlotConversionError Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

Show SlotConversionError Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

Generic SlotConversionError Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

ToJSON SlotConversionError Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

FromJSON SlotConversionError Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

Pretty SlotConversionError Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

type Rep SlotConversionError Source #
Instance details

Defined in Cardano.Node.Emulator.TimeSlot

type Rep SlotConversionError = D1 (' MetaData "SlotConversionError" "Cardano.Node.Emulator.TimeSlot" "cardano-node-emulator-1.2.0.0-AoNv3krP7ndKjYjVelWOdO" ' False ) ( C1 (' MetaCons "SlotOutOfRange" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "requestedSlot") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Slot) :*: S1 (' MetaSel (' Just "horizon") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 (Slot, POSIXTime ))))

slotRangeToPOSIXTimeRange :: SlotConfig -> SlotRange -> POSIXTimeRange Source #

Convert a SlotRange to a POSIXTimeRange given a SlotConfig . The resulting POSIXTimeRange refers to the starting time of the lower bound of the SlotRange and the ending time of the upper bound of the SlotRange .

slotToPOSIXTimeRange :: SlotConfig -> Slot -> POSIXTimeRange Source #

Convert a Slot to a POSIXTimeRange given a SlotConfig . Each Slot can be represented by an interval of time.

posixTimeRangeToContainedSlotRange :: SlotConfig -> POSIXTimeRange -> SlotRange Source #

Convert a POSIXTimeRange to SlotRange given a SlotConfig . This gives the biggest slot range that is entirely contained by the given time range.

currentSlot :: SlotConfig -> IO Slot Source #

Get the current slot number