| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Byron.Ledger.Block
Synopsis
- newtype ByronHash = ByronHash {}
- mkByronHash :: ABlockOrBoundaryHdr ByteString -> ByronHash
- data ByronBlock = ByronBlock {}
- mkByronBlock :: EpochSlots -> ABlockOrBoundary ByteString -> ByronBlock
- annotateByronBlock :: EpochSlots -> Block -> ByronBlock
- data family Header blk
- mkByronHeader :: EpochSlots -> ABlockOrBoundaryHdr ByteString -> SizeInBytes -> Header ByronBlock
- mkRegularByronHeader :: AHeader ByteString -> SizeInBytes -> Header ByronBlock
- mkBoundaryByronHeader :: SlotNo -> ABoundaryHeader ByteString -> SizeInBytes -> Header ByronBlock
- byronHeaderIsEBB :: Header ByronBlock -> IsEBB
- byronBlockIsEBB :: ByronBlock -> IsEBB
- knownEBBs :: Map (HeaderHash ByronBlock) (ChainHash ByronBlock)
- data UnsizedHeader = UnsizedHeader {}
- mkUnsizedHeader :: EpochSlots -> ABlockOrBoundaryHdr ByteString -> UnsizedHeader
- splitSizeHint :: Header ByronBlock -> (UnsizedHeader, SizeInBytes)
- joinSizeHint :: UnsizedHeader -> SizeInBytes -> Header ByronBlock
Hash
Constructors
| ByronHash | |
Fields | |
Instances
| Eq ByronHash Source # | |
| Ord ByronHash Source # | |
Defined in Ouroboros.Consensus.Byron.Ledger.Block | |
| Show ByronHash Source # | |
| Generic ByronHash Source # | |
| ToCBOR ByronHash Source # | |
| FromCBOR ByronHash Source # | |
| NoThunks ByronHash Source # | |
| Serialise ByronHash Source # | |
| Condense ByronHash Source # | |
| type Rep ByronHash Source # | |
Defined in Ouroboros.Consensus.Byron.Ledger.Block type Rep ByronHash = D1 ('MetaData "ByronHash" "Ouroboros.Consensus.Byron.Ledger.Block" "ouroboros-consensus-byron-0.1.0.0-GJfZjV8qqNI4kWb01fxkk3" 'True) (C1 ('MetaCons "ByronHash" 'PrefixI 'True) (S1 ('MetaSel ('Just "unByronHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HeaderHash))) | |
Block
data ByronBlock Source #
Byron block
We cache two bits of information:
- We cache the slot number as this is not readily available for EBBs.
Having it cached allows us to e.g. give a
HasHeaderinstance. - We cache the hash as this is expensive to compute and we need it often.
Constructors
| ByronBlock | |
Fields | |
Instances
annotateByronBlock :: EpochSlots -> Block -> ByronBlock Source #
Construct Byron block from unannotated Block
This should be used only when forging blocks (not when receiving blocks over the wire).
Header
data family Header blk Source #
Instances
Arguments
| :: EpochSlots | |
| -> ABlockOrBoundaryHdr ByteString | |
| -> SizeInBytes | Block size hint |
| -> Header ByronBlock |
mkBoundaryByronHeader :: SlotNo -> ABoundaryHeader ByteString -> SizeInBytes -> Header ByronBlock Source #
Dealing with EBBs
byronHeaderIsEBB :: Header ByronBlock -> IsEBB Source #
byronBlockIsEBB :: ByronBlock -> IsEBB Source #
Low-level API
data UnsizedHeader Source #
Header without a size hint
Defined in order to support backwards compatible binary encodings.
Constructors
| UnsizedHeader | |
Fields | |
splitSizeHint :: Header ByronBlock -> (UnsizedHeader, SizeInBytes) Source #
joinSizeHint :: UnsizedHeader -> SizeInBytes -> Header ByronBlock Source #