ouroboros-consensus-protocol-0.9.0.2: Cardano consensus protocols
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Consensus.Protocol.Praos.Header

Description

Block header associated with Praos.

The choice of whether to associate the header with the ledger era or the protocol is a little artitrary. Functionally the header contains things which are associated with both ledger and protocol, and which are used by both.

We choose to associate the header with the protocol, since it more strongly binds in that direction, and to assist with the mental picture that the protocol is concerned with the block header, while the ledger is concerned with the block body. However, in order to more cleanly illustrate which parts of the header are _strictly_ protocol concerns, we also provide a view of the header (in Views) which extracts just the fields needed for the Praos protocol. This also allows us to hide the more detailed construction of the header.

Synopsis

Documentation

data Header crypto where Source #

Full header type, carrying its own memoised bytes.

Bundled Patterns

pattern HeaderCrypto crypto ⇒ HeaderBody crypto → SignedKES crypto (HeaderBody crypto) → Header crypto 

Instances

Instances details
Generic (Header crypto) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Header

Associated Types

type Rep (Header crypto) ∷ TypeType #

Methods

fromHeader crypto → Rep (Header crypto) x #

toRep (Header crypto) x → Header crypto #

Crypto crypto ⇒ Show (Header crypto) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Header

Methods

showsPrecIntHeader crypto → ShowS #

showHeader crypto → String #

showList ∷ [Header crypto] → ShowS #

Crypto c ⇒ ToCBOR (Header c) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Header

Methods

toCBORHeader c → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Header c) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Header c] → Size Source #

Crypto c ⇒ DecCBOR (Annotator (Header c)) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Header

Crypto c ⇒ EncCBOR (Header c) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Header

Methods

encCBORHeader c → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (Header c) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [Header c] → Size Source #

Crypto c ⇒ Eq (Header c) Source #

Checks the binary representation first.

Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Header

Methods

(==)Header c → Header c → Bool #

(/=)Header c → Header c → Bool #

Crypto crypto ⇒ NoThunks (Header crypto) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Header

Methods

noThunksContextHeader crypto → IO (Maybe ThunkInfo) Source #

wNoThunksContextHeader crypto → IO (Maybe ThunkInfo) Source #

showTypeOfProxy (Header crypto) → String Source #

type Rep (Header crypto) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Header

type Rep (Header crypto)

data HeaderBody crypto Source #

The body of the header is the part which gets hashed to form the hash chain.

Constructors

HeaderBody 

Fields

Instances

Instances details
Generic (HeaderBody crypto) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Header

Associated Types

type Rep (HeaderBody crypto) ∷ TypeType #

Methods

fromHeaderBody crypto → Rep (HeaderBody crypto) x #

toRep (HeaderBody crypto) x → HeaderBody crypto #

Crypto crypto ⇒ Show (HeaderBody crypto) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Header

Methods

showsPrecIntHeaderBody crypto → ShowS #

showHeaderBody crypto → String #

showList ∷ [HeaderBody crypto] → ShowS #

Crypto crypto ⇒ SignableRepresentation (HeaderBody crypto) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Header

Crypto crypto ⇒ DecCBOR (HeaderBody crypto) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Header

Methods

decCBORDecoder s (HeaderBody crypto) Source #

dropCBORProxy (HeaderBody crypto) → Decoder s () Source #

labelProxy (HeaderBody crypto) → Text Source #

Crypto crypto ⇒ EncCBOR (HeaderBody crypto) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Header

Methods

encCBORHeaderBody crypto → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (HeaderBody crypto) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [HeaderBody crypto] → Size Source #

Crypto crypto ⇒ Eq (HeaderBody crypto) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Header

Methods

(==)HeaderBody crypto → HeaderBody crypto → Bool #

(/=)HeaderBody crypto → HeaderBody crypto → Bool #

Crypto crypto ⇒ NoThunks (HeaderBody crypto) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Header

type Rep (HeaderBody crypto) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Header

headerHashCrypto crypto ⇒ Header crypto → Hash (HASH crypto) EraIndependentBlockHeader Source #

Hash a header

headerSizeHeader crypto → Int Source #

Compute the size of the header