{-# LANGUAGE DataKinds #-}
module Ouroboros.Consensus.Protocol.Praos.Views (
HeaderView (..)
, LedgerView (..)
) where
import Cardano.Crypto.KES (SignedKES)
import Cardano.Crypto.VRF (CertifiedVRF, VRFAlgorithm (VerKeyVRF))
import Cardano.Ledger.BaseTypes (ProtVer)
import Cardano.Ledger.Crypto (KES, VRF)
import Cardano.Ledger.Keys (KeyRole (BlockIssuer), VKey)
import qualified Cardano.Ledger.Shelley.API as SL
import Cardano.Protocol.TPraos.BHeader (PrevHash)
import Cardano.Protocol.TPraos.OCert (OCert)
import Cardano.Slotting.Slot (SlotNo)
import Data.Word (Word16, Word32)
import Ouroboros.Consensus.Protocol.Praos.Header (HeaderBody)
import Ouroboros.Consensus.Protocol.Praos.VRF (InputVRF)
data crypto =
{
forall crypto. HeaderView crypto -> PrevHash crypto
hvPrevHash :: !(PrevHash crypto),
forall crypto. HeaderView crypto -> VKey 'BlockIssuer crypto
hvVK :: !(VKey 'BlockIssuer crypto),
forall crypto. HeaderView crypto -> VerKeyVRF (VRF crypto)
hvVrfVK :: !(VerKeyVRF (VRF crypto)),
forall crypto.
HeaderView crypto -> CertifiedVRF (VRF crypto) InputVRF
hvVrfRes :: !(CertifiedVRF (VRF crypto) InputVRF),
forall crypto. HeaderView crypto -> OCert crypto
hvOCert :: !(OCert crypto),
forall crypto. HeaderView crypto -> SlotNo
hvSlotNo :: !SlotNo,
forall crypto. HeaderView crypto -> HeaderBody crypto
hvSigned :: !(HeaderBody crypto),
forall crypto.
HeaderView crypto -> SignedKES (KES crypto) (HeaderBody crypto)
hvSignature :: !(SignedKES (KES crypto) (HeaderBody crypto))
}
data LedgerView crypto = LedgerView
{
forall crypto. LedgerView crypto -> PoolDistr crypto
lvPoolDistr :: SL.PoolDistr crypto,
:: !Word16,
forall crypto. LedgerView crypto -> Word32
lvMaxBodySize :: !Word32,
forall crypto. LedgerView crypto -> ProtVer
lvProtocolVersion :: !ProtVer
}
deriving (Int -> LedgerView crypto -> ShowS
[LedgerView crypto] -> ShowS
LedgerView crypto -> String
(Int -> LedgerView crypto -> ShowS)
-> (LedgerView crypto -> String)
-> ([LedgerView crypto] -> ShowS)
-> Show (LedgerView crypto)
forall crypto. Int -> LedgerView crypto -> ShowS
forall crypto. [LedgerView crypto] -> ShowS
forall crypto. LedgerView crypto -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall crypto. Int -> LedgerView crypto -> ShowS
showsPrec :: Int -> LedgerView crypto -> ShowS
$cshow :: forall crypto. LedgerView crypto -> String
show :: LedgerView crypto -> String
$cshowList :: forall crypto. [LedgerView crypto] -> ShowS
showList :: [LedgerView crypto] -> ShowS
Show)