{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
module Ouroboros.Network.ConsensusMode where
import Data.Aeson
import GHC.Generics (Generic)
data ConsensusMode =
GenesisMode
| PraosMode
deriving (ConsensusMode -> ConsensusMode -> Bool
(ConsensusMode -> ConsensusMode -> Bool)
-> (ConsensusMode -> ConsensusMode -> Bool) -> Eq ConsensusMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConsensusMode -> ConsensusMode -> Bool
== :: ConsensusMode -> ConsensusMode -> Bool
$c/= :: ConsensusMode -> ConsensusMode -> Bool
/= :: ConsensusMode -> ConsensusMode -> Bool
Eq, Int -> ConsensusMode -> ShowS
[ConsensusMode] -> ShowS
ConsensusMode -> String
(Int -> ConsensusMode -> ShowS)
-> (ConsensusMode -> String)
-> ([ConsensusMode] -> ShowS)
-> Show ConsensusMode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ConsensusMode -> ShowS
showsPrec :: Int -> ConsensusMode -> ShowS
$cshow :: ConsensusMode -> String
show :: ConsensusMode -> String
$cshowList :: [ConsensusMode] -> ShowS
showList :: [ConsensusMode] -> ShowS
Show, (forall x. ConsensusMode -> Rep ConsensusMode x)
-> (forall x. Rep ConsensusMode x -> ConsensusMode)
-> Generic ConsensusMode
forall x. Rep ConsensusMode x -> ConsensusMode
forall x. ConsensusMode -> Rep ConsensusMode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ConsensusMode -> Rep ConsensusMode x
from :: forall x. ConsensusMode -> Rep ConsensusMode x
$cto :: forall x. Rep ConsensusMode x -> ConsensusMode
to :: forall x. Rep ConsensusMode x -> ConsensusMode
Generic, Maybe ConsensusMode
Value -> Parser [ConsensusMode]
Value -> Parser ConsensusMode
(Value -> Parser ConsensusMode)
-> (Value -> Parser [ConsensusMode])
-> Maybe ConsensusMode
-> FromJSON ConsensusMode
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser ConsensusMode
parseJSON :: Value -> Parser ConsensusMode
$cparseJSONList :: Value -> Parser [ConsensusMode]
parseJSONList :: Value -> Parser [ConsensusMode]
$comittedField :: Maybe ConsensusMode
omittedField :: Maybe ConsensusMode
FromJSON)
defaultConsensusMode :: ConsensusMode
defaultConsensusMode :: ConsensusMode
defaultConsensusMode = ConsensusMode
PraosMode