hydra-node-0.19.0: The Hydra node
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Chain.Direct.TimeHandle

Description

Module to deal with time in direct cardano chain layer. Defines the type for a PointInTime and a means to acquire one via a TimeHandle and queryTimeHandle.

Synopsis

Documentation

data TimeHandle Source #

Constructors

TimeHandle 

Fields

Instances

Instances details
Arbitrary TimeHandle Source # 
Instance details

Defined in Hydra.Chain.Direct.TimeHandle

data TimeHandleParams Source #

Constructors

TimeHandleParams 

Fields

genTimeParams :: Gen TimeHandleParams Source #

Generate consistent values for SystemStart and EraHistory which has a horizon at the returned SlotNo as well as some UTCTime before that

mkTimeHandle :: HasCallStack => SlotNo -> SystemStart -> EraHistory -> TimeHandle Source #

Construct a time handle using current slot and given chain parameters. See queryTimeHandle to create one by querying a cardano-node.

queryTimeHandle :: NetworkId -> SocketPath -> IO TimeHandle Source #

Query node for system start and era history before constructing a TimeHandle using the slot at the tip of the network.