cardano-node-emulator-1.2.0.0
Safe HaskellNone
LanguageHaskell2010

Cardano.Node.Emulator.Internal.Node.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.Internal.Node.TimeSlot

Show SlotConfig Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

Generic SlotConfig Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

Associated Types

type Rep SlotConfig :: Type -> Type Source #

Serialise SlotConfig Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

Methods

encode :: SlotConfig -> Encoding

decode :: Decoder s SlotConfig

encodeList :: [SlotConfig] -> Encoding

decodeList :: Decoder s [SlotConfig]

FromJSON SlotConfig Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

Methods

parseJSON :: Value -> Parser SlotConfig

parseJSONList :: Value -> Parser [SlotConfig]

ToJSON SlotConfig Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

Methods

toJSON :: SlotConfig -> Value

toEncoding :: SlotConfig -> Encoding

toJSONList :: [SlotConfig] -> Value

toEncodingList :: [SlotConfig] -> Encoding

Default SlotConfig Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

Methods

def :: SlotConfig

Pretty SlotConfig Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

Methods

pretty :: SlotConfig -> Doc ann

prettyList :: [SlotConfig] -> Doc ann

Lift DefaultUni SlotConfig Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

Methods

lift :: SlotConfig -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni SlotConfig Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

Methods

typeRep :: Proxy SlotConfig -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep SlotConfig Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

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

data SlotConversionError Source #

Constructors

SlotOutOfRange 

Fields

Instances

Instances details
Eq SlotConversionError Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

Show SlotConversionError Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

Generic SlotConversionError Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

Associated Types

type Rep SlotConversionError :: Type -> Type Source #

FromJSON SlotConversionError Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

Methods

parseJSON :: Value -> Parser SlotConversionError

parseJSONList :: Value -> Parser [SlotConversionError]

ToJSON SlotConversionError Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

Pretty SlotConversionError Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

Methods

pretty :: SlotConversionError -> Doc ann

prettyList :: [SlotConversionError] -> Doc ann

type Rep SlotConversionError Source # 
Instance details

Defined in Cardano.Node.Emulator.Internal.Node.TimeSlot

type Rep SlotConversionError = D1 ('MetaData "SlotConversionError" "Cardano.Node.Emulator.Internal.Node.TimeSlot" "cardano-node-emulator-1.2.0.0-1RjxyDmnwHSAn2KgGdAUXD" 'False) (C1 ('MetaCons "SlotOutOfRange" 'PrefixI 'True) (S1 ('MetaSel ('Just "requestedSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Slot) :*: S1 ('MetaSel ('Just "horizon") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (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.

slotToBeginPOSIXTime :: SlotConfig -> Slot -> POSIXTime Source #

Get the starting POSIXTime of a Slot given a SlotConfig.

slotToEndPOSIXTime :: SlotConfig -> Slot -> POSIXTime Source #

Get the ending POSIXTime of a Slot given a SlotConfig.

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.

posixTimeToEnclosingSlot :: SlotConfig -> POSIXTime -> Slot Source #

Convert a POSIXTime to Slot given a SlotConfig.

currentSlot :: SlotConfig -> IO Slot Source #

Get the current slot number

utcTimeToPOSIXTime :: UTCTime -> POSIXTime Source #

posixTimeToUTCTime :: POSIXTime -> UTCTime Source #

nominalDiffTimeToPOSIXTime :: NominalDiffTime -> POSIXTime Source #

posixTimeToNominalDiffTime :: POSIXTime -> NominalDiffTime Source #