Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Byron.Ledger.Block
Contents
Synopsis
- newtype ByronHash = ByronHash { }
- mkByronHash :: ABlockOrBoundaryHdr ByteString -> ByronHash
-
data
ByronBlock
=
ByronBlock
{
- byronBlockRaw :: !( ABlockOrBoundary ByteString )
- byronBlockSlotNo :: ! SlotNo
- byronBlockHash :: ! ByronHash
- annotateByronBlock :: EpochSlots -> Block -> ByronBlock
- mkByronBlock :: EpochSlots -> ABlockOrBoundary ByteString -> ByronBlock
- data family Header blk
- mkBoundaryByronHeader :: SlotNo -> ABoundaryHeader ByteString -> SizeInBytes -> Header ByronBlock
- mkByronHeader :: EpochSlots -> ABlockOrBoundaryHdr ByteString -> SizeInBytes -> Header ByronBlock
- mkRegularByronHeader :: AHeader ByteString -> SizeInBytes -> Header ByronBlock
- byronBlockIsEBB :: ByronBlock -> IsEBB
- byronHeaderIsEBB :: Header ByronBlock -> IsEBB
- knownEBBs :: Map ( HeaderHash ByronBlock ) ( ChainHash ByronBlock )
-
data
UnsizedHeader
=
UnsizedHeader
{
- unsizedHeaderRaw :: !( ABlockOrBoundaryHdr ByteString )
- unsizedHeaderSlotNo :: ! SlotNo
- unsizedHeaderHash :: ! ByronHash
- joinSizeHint :: UnsizedHeader -> SizeInBytes -> Header ByronBlock
- mkUnsizedHeader :: EpochSlots -> ABlockOrBoundaryHdr ByteString -> UnsizedHeader
- splitSizeHint :: Header ByronBlock -> ( UnsizedHeader , SizeInBytes )
Hash
Constructors
ByronHash | |
Fields |
Instances
Eq ByronHash Source # | |
Ord ByronHash Source # | |
Defined in Ouroboros.Consensus.Byron.Ledger.Block Methods compare :: ByronHash -> ByronHash -> Ordering Source # (<) :: ByronHash -> ByronHash -> Bool Source # (<=) :: ByronHash -> ByronHash -> Bool Source # (>) :: ByronHash -> ByronHash -> Bool Source # (>=) :: ByronHash -> ByronHash -> Bool Source # |
|
Show ByronHash Source # | |
Generic ByronHash Source # | |
ToCBOR ByronHash Source # | |
Defined in Ouroboros.Consensus.Byron.Ledger.Block |
|
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.1-1xx7v4AzrF0A75LZoaNMal" '
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
HasHeader
instance. - 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
mkBoundaryByronHeader :: SlotNo -> ABoundaryHeader ByteString -> SizeInBytes -> Header ByronBlock Source #
Arguments
:: EpochSlots | |
-> ABlockOrBoundaryHdr ByteString | |
-> SizeInBytes |
Block size hint |
-> Header ByronBlock |
Dealing with EBBs
byronBlockIsEBB :: ByronBlock -> IsEBB Source #
byronHeaderIsEBB :: Header ByronBlock -> IsEBB Source #
knownEBBs :: Map ( HeaderHash ByronBlock ) ( ChainHash ByronBlock ) Source #
Low-level API
data UnsizedHeader Source #
Header without a size hint
Defined in order to support backwards compatible binary encodings.
Constructors
UnsizedHeader | |
Fields
|
joinSizeHint :: UnsizedHeader -> SizeInBytes -> Header ByronBlock Source #
splitSizeHint :: Header ByronBlock -> ( UnsizedHeader , SizeInBytes ) Source #