{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE RecordWildCards #-}
module Ouroboros.Consensus.BlockchainTime.WallClock.Util (
TraceBlockchainTimeEvent (..)
, SystemClockMovedBackException (..)
) where
import Control.Exception (Exception)
import Data.Time (NominalDiffTime)
import Ouroboros.Consensus.Block
import Ouroboros.Consensus.BlockchainTime.WallClock.Types
(SystemStart)
import Ouroboros.Consensus.HardFork.History (PastHorizonException)
data TraceBlockchainTimeEvent t =
TraceStartTimeInTheFuture SystemStart NominalDiffTime
| TraceCurrentSlotUnknown t PastHorizonException
| TraceSystemClockMovedBack t t
deriving (Int -> TraceBlockchainTimeEvent t -> ShowS
[TraceBlockchainTimeEvent t] -> ShowS
TraceBlockchainTimeEvent t -> String
(Int -> TraceBlockchainTimeEvent t -> ShowS)
-> (TraceBlockchainTimeEvent t -> String)
-> ([TraceBlockchainTimeEvent t] -> ShowS)
-> Show (TraceBlockchainTimeEvent t)
forall t. Show t => Int -> TraceBlockchainTimeEvent t -> ShowS
forall t. Show t => [TraceBlockchainTimeEvent t] -> ShowS
forall t. Show t => TraceBlockchainTimeEvent t -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TraceBlockchainTimeEvent t] -> ShowS
$cshowList :: forall t. Show t => [TraceBlockchainTimeEvent t] -> ShowS
show :: TraceBlockchainTimeEvent t -> String
$cshow :: forall t. Show t => TraceBlockchainTimeEvent t -> String
showsPrec :: Int -> TraceBlockchainTimeEvent t -> ShowS
$cshowsPrec :: forall t. Show t => Int -> TraceBlockchainTimeEvent t -> ShowS
Show, a -> TraceBlockchainTimeEvent b -> TraceBlockchainTimeEvent a
(a -> b)
-> TraceBlockchainTimeEvent a -> TraceBlockchainTimeEvent b
(forall a b.
(a -> b)
-> TraceBlockchainTimeEvent a -> TraceBlockchainTimeEvent b)
-> (forall a b.
a -> TraceBlockchainTimeEvent b -> TraceBlockchainTimeEvent a)
-> Functor TraceBlockchainTimeEvent
forall a b.
a -> TraceBlockchainTimeEvent b -> TraceBlockchainTimeEvent a
forall a b.
(a -> b)
-> TraceBlockchainTimeEvent a -> TraceBlockchainTimeEvent b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> TraceBlockchainTimeEvent b -> TraceBlockchainTimeEvent a
$c<$ :: forall a b.
a -> TraceBlockchainTimeEvent b -> TraceBlockchainTimeEvent a
fmap :: (a -> b)
-> TraceBlockchainTimeEvent a -> TraceBlockchainTimeEvent b
$cfmap :: forall a b.
(a -> b)
-> TraceBlockchainTimeEvent a -> TraceBlockchainTimeEvent b
Functor)
data SystemClockMovedBackException =
SystemClockMovedBack SlotNo SlotNo
deriving (Int -> SystemClockMovedBackException -> ShowS
[SystemClockMovedBackException] -> ShowS
SystemClockMovedBackException -> String
(Int -> SystemClockMovedBackException -> ShowS)
-> (SystemClockMovedBackException -> String)
-> ([SystemClockMovedBackException] -> ShowS)
-> Show SystemClockMovedBackException
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SystemClockMovedBackException] -> ShowS
$cshowList :: [SystemClockMovedBackException] -> ShowS
show :: SystemClockMovedBackException -> String
$cshow :: SystemClockMovedBackException -> String
showsPrec :: Int -> SystemClockMovedBackException -> ShowS
$cshowsPrec :: Int -> SystemClockMovedBackException -> ShowS
Show)
instance Exception SystemClockMovedBackException