{-# LANGUAGE RankNTypes #-}
module Cardano.Network.LedgerPeerConsensusInterface
( LedgerPeersConsensusInterface (..)
, GetImmutableBlockPointError (..)
, FetchMode (..)
, LedgerStateJudgement (..)
, OutboundConnectionsState (..)
) where
import Control.Concurrent.Class.MonadSTM (MonadSTM (..))
import Cardano.Network.LedgerStateJudgement
import Cardano.Network.PeerSelection.LocalRootPeers
(OutboundConnectionsState (..))
import Ouroboros.Network.Block (Point)
import Ouroboros.Network.BlockFetch.ConsensusInterface (FetchMode (..))
import Ouroboros.Network.PeerSelection.LedgerPeers.Type (RawBlockHash)
data GetImmutableBlockPointError
=
ImmutableBlockPointGenesisPoint
|
ImmutableBlockPointNotYetImmutable
|
ImmutableBlockPointTipIsOrigin
deriving (Int -> GetImmutableBlockPointError -> ShowS
[GetImmutableBlockPointError] -> ShowS
GetImmutableBlockPointError -> String
(Int -> GetImmutableBlockPointError -> ShowS)
-> (GetImmutableBlockPointError -> String)
-> ([GetImmutableBlockPointError] -> ShowS)
-> Show GetImmutableBlockPointError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetImmutableBlockPointError -> ShowS
showsPrec :: Int -> GetImmutableBlockPointError -> ShowS
$cshow :: GetImmutableBlockPointError -> String
show :: GetImmutableBlockPointError -> String
$cshowList :: [GetImmutableBlockPointError] -> ShowS
showList :: [GetImmutableBlockPointError] -> ShowS
Show, GetImmutableBlockPointError -> GetImmutableBlockPointError -> Bool
(GetImmutableBlockPointError
-> GetImmutableBlockPointError -> Bool)
-> (GetImmutableBlockPointError
-> GetImmutableBlockPointError -> Bool)
-> Eq GetImmutableBlockPointError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetImmutableBlockPointError -> GetImmutableBlockPointError -> Bool
== :: GetImmutableBlockPointError -> GetImmutableBlockPointError -> Bool
$c/= :: GetImmutableBlockPointError -> GetImmutableBlockPointError -> Bool
/= :: GetImmutableBlockPointError -> GetImmutableBlockPointError -> Bool
Eq)
data LedgerPeersConsensusInterface m =
LedgerPeersConsensusInterface {
forall (m :: * -> *).
LedgerPeersConsensusInterface m -> STM m FetchMode
readFetchMode :: STM m FetchMode
, forall (m :: * -> *).
LedgerPeersConsensusInterface m -> STM m LedgerStateJudgement
getLedgerStateJudgement :: STM m LedgerStateJudgement
, forall (m :: * -> *).
LedgerPeersConsensusInterface m
-> OutboundConnectionsState -> STM m ()
updateOutboundConnectionsState :: OutboundConnectionsState -> STM m ()
, forall (m :: * -> *).
LedgerPeersConsensusInterface m
-> forall r.
Point RawBlockHash
-> (m (Either GetImmutableBlockPointError (Point RawBlockHash))
-> m r)
-> m r
getImmutableBlockPoint
:: forall r. Point RawBlockHash
-> (m (Either GetImmutableBlockPointError (Point RawBlockHash)) -> m r)
-> m r
}