{-# LANGUAGE DeriveFunctor #-}
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
$cshowsPrec :: forall t. Show t => Int -> TraceBlockchainTimeEvent t -> ShowS
showsPrec :: Int -> TraceBlockchainTimeEvent t -> ShowS
$cshow :: forall t. Show t => TraceBlockchainTimeEvent t -> String
show :: TraceBlockchainTimeEvent t -> String
$cshowList :: forall t. Show t => [TraceBlockchainTimeEvent t] -> ShowS
showList :: [TraceBlockchainTimeEvent t] -> ShowS
Show, (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
$cfmap :: forall a b.
(a -> b)
-> TraceBlockchainTimeEvent a -> TraceBlockchainTimeEvent b
fmap :: forall a b.
(a -> b)
-> TraceBlockchainTimeEvent a -> TraceBlockchainTimeEvent b
$c<$ :: forall a b.
a -> TraceBlockchainTimeEvent b -> TraceBlockchainTimeEvent a
<$ :: forall a b.
a -> TraceBlockchainTimeEvent b -> TraceBlockchainTimeEvent a
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
$cshowsPrec :: Int -> SystemClockMovedBackException -> ShowS
showsPrec :: Int -> SystemClockMovedBackException -> ShowS
$cshow :: SystemClockMovedBackException -> String
show :: SystemClockMovedBackException -> String
$cshowList :: [SystemClockMovedBackException] -> ShowS
showList :: [SystemClockMovedBackException] -> ShowS
Show)
instance Exception SystemClockMovedBackException