{-# LANGUAGE DeriveGeneric #-}

module Ouroboros.Network.PeerSelection.LocalRootPeers (OutboundConnectionsState (..)) where

import GHC.Generics
import NoThunks.Class

data OutboundConnectionsState =
    TrustedStateWithExternalPeers
    -- ^
    -- * /in the Praos mode/: connected only to trusted local
    --   peers and at least one bootstrap peer or public root;
    -- * /in the Genesis mode/: meeting target of active big ledger peers;
    -- * or it is in `LocalRootsOnly` mode and indeed only connected to
    --   trusted local root peers (see
    --   `Ouroboros.Network.PeerSelection.Governor.AssociationMode`).

  | UntrustedState
    -- ^ catch all other cases
  deriving (OutboundConnectionsState -> OutboundConnectionsState -> Bool
(OutboundConnectionsState -> OutboundConnectionsState -> Bool)
-> (OutboundConnectionsState -> OutboundConnectionsState -> Bool)
-> Eq OutboundConnectionsState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: OutboundConnectionsState -> OutboundConnectionsState -> Bool
== :: OutboundConnectionsState -> OutboundConnectionsState -> Bool
$c/= :: OutboundConnectionsState -> OutboundConnectionsState -> Bool
/= :: OutboundConnectionsState -> OutboundConnectionsState -> Bool
Eq, Int -> OutboundConnectionsState -> ShowS
[OutboundConnectionsState] -> ShowS
OutboundConnectionsState -> String
(Int -> OutboundConnectionsState -> ShowS)
-> (OutboundConnectionsState -> String)
-> ([OutboundConnectionsState] -> ShowS)
-> Show OutboundConnectionsState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> OutboundConnectionsState -> ShowS
showsPrec :: Int -> OutboundConnectionsState -> ShowS
$cshow :: OutboundConnectionsState -> String
show :: OutboundConnectionsState -> String
$cshowList :: [OutboundConnectionsState] -> ShowS
showList :: [OutboundConnectionsState] -> ShowS
Show, (forall x.
 OutboundConnectionsState -> Rep OutboundConnectionsState x)
-> (forall x.
    Rep OutboundConnectionsState x -> OutboundConnectionsState)
-> Generic OutboundConnectionsState
forall x.
Rep OutboundConnectionsState x -> OutboundConnectionsState
forall x.
OutboundConnectionsState -> Rep OutboundConnectionsState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
OutboundConnectionsState -> Rep OutboundConnectionsState x
from :: forall x.
OutboundConnectionsState -> Rep OutboundConnectionsState x
$cto :: forall x.
Rep OutboundConnectionsState x -> OutboundConnectionsState
to :: forall x.
Rep OutboundConnectionsState x -> OutboundConnectionsState
Generic)

instance NoThunks OutboundConnectionsState