| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.BlockchainTime.WallClock.Types
Synopsis
- newtype SystemStart = SystemStart {}
- newtype RelativeTime = RelativeTime {}
- addRelTime ∷ NominalDiffTime → RelativeTime → RelativeTime
- diffRelTime ∷ RelativeTime → RelativeTime → NominalDiffTime
- fromRelativeTime ∷ SystemStart → RelativeTime → UTCTime
- toRelativeTime ∷ SystemStart → UTCTime → RelativeTime
- data SystemTime (m ∷ Type → Type) = SystemTime {
- systemTimeCurrent ∷ m RelativeTime
- systemTimeWait ∷ m ()
- data WithArrivalTime a = WithArrivalTime {}
- addArrivalTime ∷ Monad m ⇒ SystemTime m → a → m (WithArrivalTime a)
- getSlotLength ∷ SlotLength → NominalDiffTime
- mkSlotLength ∷ NominalDiffTime → SlotLength
- slotLengthFromMillisec ∷ Integer → SlotLength
- slotLengthFromSec ∷ Integer → SlotLength
- slotLengthToMillisec ∷ SlotLength → Integer
- slotLengthToSec ∷ SlotLength → Integer
- data SlotLength
System time
newtype SystemStart Source #
System start
Slots are counted from the system start.
Constructors
| SystemStart | |
Fields | |
Instances
Relative time
newtype RelativeTime Source #
RelativeTime is time relative to the SystemStart
Precision is in picoseconds
Constructors
| RelativeTime | |
Fields | |
Instances
| FromJSON RelativeTime | |||||
Defined in Cardano.Slotting.Time Methods parseJSON ∷ Value → Parser RelativeTime Source # parseJSONList ∷ Value → Parser [RelativeTime] Source # | |||||
| ToJSON RelativeTime | |||||
Defined in Cardano.Slotting.Time Methods toJSON ∷ RelativeTime → Value Source # toEncoding ∷ RelativeTime → Encoding Source # toJSONList ∷ [RelativeTime] → Value Source # toEncodingList ∷ [RelativeTime] → Encoding Source # omitField ∷ RelativeTime → Bool Source # | |||||
| FromCBOR RelativeTime | |||||
Defined in Cardano.Slotting.Time | |||||
| ToCBOR RelativeTime | |||||
Defined in Cardano.Slotting.Time Methods toCBOR ∷ RelativeTime → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy RelativeTime → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [RelativeTime] → Size Source # | |||||
| Generic RelativeTime | |||||
Defined in Cardano.Slotting.Time Associated Types
| |||||
| Show RelativeTime | |||||
Defined in Cardano.Slotting.Time Methods showsPrec ∷ Int → RelativeTime → ShowS # show ∷ RelativeTime → String # showList ∷ [RelativeTime] → ShowS # | |||||
| Eq RelativeTime | |||||
Defined in Cardano.Slotting.Time | |||||
| Ord RelativeTime | |||||
Defined in Cardano.Slotting.Time Methods compare ∷ RelativeTime → RelativeTime → Ordering # (<) ∷ RelativeTime → RelativeTime → Bool # (<=) ∷ RelativeTime → RelativeTime → Bool # (>) ∷ RelativeTime → RelativeTime → Bool # (>=) ∷ RelativeTime → RelativeTime → Bool # max ∷ RelativeTime → RelativeTime → RelativeTime # min ∷ RelativeTime → RelativeTime → RelativeTime # | |||||
| NoThunks RelativeTime | |||||
Defined in Cardano.Slotting.Time | |||||
| Serialise RelativeTime | |||||
Defined in Cardano.Slotting.Time Methods encode ∷ RelativeTime → Encoding Source # decode ∷ Decoder s RelativeTime Source # encodeList ∷ [RelativeTime] → Encoding Source # decodeList ∷ Decoder s [RelativeTime] Source # | |||||
| type Rep RelativeTime | |||||
Defined in Cardano.Slotting.Time type Rep RelativeTime = D1 ('MetaData "RelativeTime" "Cardano.Slotting.Time" "cardano-slotting-0.2.1.0-6a640601bcdd908b3acccaa4067981a6fe814eec078c47e5341dcc9a50e7e2e0" 'True) (C1 ('MetaCons "RelativeTime" 'PrefixI 'True) (S1 ('MetaSel ('Just "getRelativeTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalDiffTime))) | |||||
Get current time (as RelativeTime)
data SystemTime (m ∷ Type → Type) Source #
System time
Slots are counted from the system start.
Constructors
| SystemTime | |
Fields
| |
Instances
| NoThunks (SystemTime m) Source # | |
Attach an arrival time (as RelativeTime) to an object
data WithArrivalTime a Source #
WithArrivalTime
Constructors
| WithArrivalTime | |
Fields
| |
Instances
| Generic (WithArrivalTime a) Source # | |||||
Defined in Ouroboros.Consensus.BlockchainTime.WallClock.Types Associated Types
Methods from ∷ WithArrivalTime a → Rep (WithArrivalTime a) x # to ∷ Rep (WithArrivalTime a) x → WithArrivalTime a # | |||||
| Show a ⇒ Show (WithArrivalTime a) Source # | |||||
Defined in Ouroboros.Consensus.BlockchainTime.WallClock.Types Methods showsPrec ∷ Int → WithArrivalTime a → ShowS # show ∷ WithArrivalTime a → String # showList ∷ [WithArrivalTime a] → ShowS # | |||||
| Eq a ⇒ Eq (WithArrivalTime a) Source # | |||||
Defined in Ouroboros.Consensus.BlockchainTime.WallClock.Types Methods (==) ∷ WithArrivalTime a → WithArrivalTime a → Bool # (/=) ∷ WithArrivalTime a → WithArrivalTime a → Bool # | |||||
| Ord a ⇒ Ord (WithArrivalTime a) Source # | |||||
Defined in Ouroboros.Consensus.BlockchainTime.WallClock.Types Methods compare ∷ WithArrivalTime a → WithArrivalTime a → Ordering # (<) ∷ WithArrivalTime a → WithArrivalTime a → Bool # (<=) ∷ WithArrivalTime a → WithArrivalTime a → Bool # (>) ∷ WithArrivalTime a → WithArrivalTime a → Bool # (>=) ∷ WithArrivalTime a → WithArrivalTime a → Bool # max ∷ WithArrivalTime a → WithArrivalTime a → WithArrivalTime a # min ∷ WithArrivalTime a → WithArrivalTime a → WithArrivalTime a # | |||||
| NoThunks a ⇒ NoThunks (WithArrivalTime a) Source # | |||||
| HasPerasCertBoost cert ⇒ HasPerasCertBoost (WithArrivalTime cert) Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods getPerasCertBoost ∷ WithArrivalTime cert → PerasWeight Source # | |||||
| HasPerasCertRound cert ⇒ HasPerasCertRound (WithArrivalTime cert) Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods getPerasCertRound ∷ WithArrivalTime cert → PerasRoundNo Source # | |||||
| HasPerasVoteRound vote ⇒ HasPerasVoteRound (WithArrivalTime vote) Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods getPerasVoteRound ∷ WithArrivalTime vote → PerasRoundNo Source # | |||||
| HasPerasVoteStake vote ⇒ HasPerasVoteStake (WithArrivalTime vote) Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods getPerasVoteStake ∷ WithArrivalTime vote → PerasVoteStake Source # | |||||
| HasPerasVoteVoterId vote ⇒ HasPerasVoteVoterId (WithArrivalTime vote) Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods getPerasVoteVoterId ∷ WithArrivalTime vote → PerasVoterId Source # | |||||
| HasPerasCertBoostedBlock cert blk ⇒ HasPerasCertBoostedBlock (WithArrivalTime cert) blk Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods getPerasCertBoostedBlock ∷ WithArrivalTime cert → Point blk Source # | |||||
| HasPerasVoteBlock vote blk ⇒ HasPerasVoteBlock (WithArrivalTime vote) blk Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods getPerasVoteBlock ∷ WithArrivalTime vote → Point blk Source # | |||||
| HasPerasVoteId vote blk ⇒ HasPerasVoteId (WithArrivalTime vote) blk Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods getPerasVoteId ∷ WithArrivalTime vote → PerasVoteId blk Source # | |||||
| HasPerasVoteTarget vote blk ⇒ HasPerasVoteTarget (WithArrivalTime vote) blk Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods getPerasVoteTarget ∷ WithArrivalTime vote → PerasVoteTarget blk Source # | |||||
| type Rep (WithArrivalTime a) Source # | |||||
Defined in Ouroboros.Consensus.BlockchainTime.WallClock.Types type Rep (WithArrivalTime a) = D1 ('MetaData "WithArrivalTime" "Ouroboros.Consensus.BlockchainTime.WallClock.Types" "ouroboros-consensus-1.0.0.0-inplace" 'False) (C1 ('MetaCons "WithArrivalTime" 'PrefixI 'True) (S1 ('MetaSel ('Just "getArrivalTime") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RelativeTime) :*: S1 ('MetaSel ('Just "forgetArrivalTime") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a))) | |||||
addArrivalTime ∷ Monad m ⇒ SystemTime m → a → m (WithArrivalTime a) Source #
Add an arrival time to an object
Slot length
mkSlotLength ∷ NominalDiffTime → SlotLength Source #
Constructor for SlotLength
Conversions
opaque
data SlotLength Source #
Slot length
Precision is in milliseconds
Instances
| FromCBOR SlotLength | |||||
Defined in Cardano.Slotting.Time | |||||
| ToCBOR SlotLength | |||||
Defined in Cardano.Slotting.Time Methods toCBOR ∷ SlotLength → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy SlotLength → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SlotLength] → Size Source # | |||||
| Generic SlotLength | |||||
Defined in Cardano.Slotting.Time Associated Types
| |||||
| Show SlotLength | |||||
Defined in Cardano.Slotting.Time Methods showsPrec ∷ Int → SlotLength → ShowS # show ∷ SlotLength → String # showList ∷ [SlotLength] → ShowS # | |||||
| Eq SlotLength | |||||
Defined in Cardano.Slotting.Time | |||||
| NoThunks SlotLength | |||||
Defined in Cardano.Slotting.Time | |||||
| Serialise SlotLength | |||||
Defined in Cardano.Slotting.Time Methods encode ∷ SlotLength → Encoding Source # decode ∷ Decoder s SlotLength Source # encodeList ∷ [SlotLength] → Encoding Source # decodeList ∷ Decoder s [SlotLength] Source # | |||||
| type Rep SlotLength | |||||
Defined in Cardano.Slotting.Time type Rep SlotLength = D1 ('MetaData "SlotLength" "Cardano.Slotting.Time" "cardano-slotting-0.2.1.0-6a640601bcdd908b3acccaa4067981a6fe814eec078c47e5341dcc9a50e7e2e0" 'True) (C1 ('MetaCons "SlotLength" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSlotLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalDiffTime))) | |||||