Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data BlockchainTime m = BlockchainTime {}
- data CurrentSlot
- knownSlotWatcher ∷ ∀ m. IOLike m ⇒ BlockchainTime m → (SlotNo → m ()) → Watcher m SlotNo SlotNo
Documentation
data BlockchainTime m Source #
Blockchain time
When we run the blockchain, there is a single, global time. We abstract over this here to allow to query this time (in terms of the current slot), and execute an action each time we advance a slot.
BlockchainTime | |
|
Instances
NoThunks (BlockchainTime m) Source # | |
Defined in Ouroboros.Consensus.BlockchainTime.API |
data CurrentSlot Source #
CurrentSlot !SlotNo | The current slot is known |
CurrentSlotUnknown | The current slot is not yet known This only happens when the tip of the ledger is so far behind that we
lack the information necessary to translate the current |
Instances
Generic CurrentSlot Source # | |
Defined in Ouroboros.Consensus.BlockchainTime.API type Rep CurrentSlot ∷ Type → Type # from ∷ CurrentSlot → Rep CurrentSlot x # to ∷ Rep CurrentSlot x → CurrentSlot # | |
Show CurrentSlot Source # | |
Defined in Ouroboros.Consensus.BlockchainTime.API showsPrec ∷ Int → CurrentSlot → ShowS # show ∷ CurrentSlot → String # showList ∷ [CurrentSlot] → ShowS # | |
NoThunks CurrentSlot Source # | |
Defined in Ouroboros.Consensus.BlockchainTime.API | |
type Rep CurrentSlot Source # | |
Defined in Ouroboros.Consensus.BlockchainTime.API type Rep CurrentSlot = D1 ('MetaData "CurrentSlot" "Ouroboros.Consensus.BlockchainTime.API" "ouroboros-consensus-0.21.0.0-inplace" 'False) (C1 ('MetaCons "CurrentSlot" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo)) :+: C1 ('MetaCons "CurrentSlotUnknown" 'PrefixI 'False) (U1 ∷ Type → Type)) |
Watches for changes in the current slot
The action will not be called until the current slot becomes known
(if the tip of our ledger is too far away from the current wallclock time,
we may not know what the current SlotNo
is).