Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- tipIsGenesis ∷ WithOrigin r → Bool
- newtype PrefixLen = PrefixLen {}
- addPrefixLen ∷ Word8 → PrefixLen → PrefixLen
- takePrefix ∷ PrefixLen → ByteString → ShortByteString
- data BinaryBlockInfo = BinaryBlockInfo {}
- extractHeader ∷ BinaryBlockInfo → ByteString → ByteString
- data StreamFrom blk
- = StreamFromInclusive !(RealPoint blk)
- | StreamFromExclusive !(Point blk)
- newtype StreamTo blk = StreamToInclusive (RealPoint blk)
- validBounds ∷ StandardHash blk ⇒ StreamFrom blk → StreamTo blk → Bool
- data BlockComponent blk a where
- GetVerifiedBlock ∷ BlockComponent blk blk
- GetBlock ∷ BlockComponent blk blk
- GetRawBlock ∷ BlockComponent blk ByteString
- GetHeader ∷ BlockComponent blk (Header blk)
- GetRawHeader ∷ BlockComponent blk ByteString
- GetHash ∷ BlockComponent blk (HeaderHash blk)
- GetSlot ∷ BlockComponent blk SlotNo
- GetIsEBB ∷ BlockComponent blk IsEBB
- GetBlockSize ∷ BlockComponent blk SizeInBytes
- GetHeaderSize ∷ BlockComponent blk Word16
- GetNestedCtxt ∷ BlockComponent blk (SomeSecond (NestedCtxt Header) blk)
- GetPure ∷ a → BlockComponent blk a
- GetApply ∷ BlockComponent blk (a → b) → BlockComponent blk a → BlockComponent blk b
- data SizeInBytes
Indexing
tipIsGenesis ∷ WithOrigin r → Bool Source #
PrefixLen
Number of bytes from the start of a block needed to reconstruct the nested context.
See reconstructPrefixLen
.
BinaryBlockInfo
data BinaryBlockInfo Source #
Information about the serialised block.
BinaryBlockInfo | |
|
Instances
extractHeader ∷ BinaryBlockInfo → ByteString → ByteString Source #
Extract the header from the given ByteString
using the
BinaryBlockInfo
.
Iterator bounds
data StreamFrom blk Source #
The lower bound for an iterator
Hint: use
to start streaming from
Genesis.StreamFromExclusive
genesisPoint
StreamFromInclusive !(RealPoint blk) | |
StreamFromExclusive !(Point blk) |
Instances
StreamToInclusive (RealPoint blk) |
Instances
Generic (StreamTo blk) Source # | |
StandardHash blk ⇒ Show (StreamTo blk) Source # | |
StandardHash blk ⇒ Eq (StreamTo blk) Source # | |
(StandardHash blk, Typeable blk) ⇒ NoThunks (StreamTo blk) Source # | |
type Rep (StreamTo blk) Source # | |
Defined in Ouroboros.Consensus.Storage.Common type Rep (StreamTo blk) = D1 ('MetaData "StreamTo" "Ouroboros.Consensus.Storage.Common" "ouroboros-consensus-0.21.0.0-inplace" 'True) (C1 ('MetaCons "StreamToInclusive" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RealPoint blk)))) |
validBounds ∷ StandardHash blk ⇒ StreamFrom blk → StreamTo blk → Bool Source #
Check whether the bounds make sense
An example of bounds that don't make sense:
StreamFromExclusive (BlockPoint 3 ..) StreamToInclusive (RealPoint 3 ..)
This function does not check whether the bounds correspond to existing blocks.
BlockComponent
data BlockComponent blk a where Source #
Which component of the block to read from a database: the whole block, its header, its hash, the block size, ..., or combinations thereof.
NOTE: when requesting multiple components, we will not optimise/cache them.
GetVerifiedBlock ∷ BlockComponent blk blk | Verify the integrity of the block by checking its signature and/or hashes. The interpreter should throw an exception when the block does not pass the check. |
GetBlock ∷ BlockComponent blk blk | |
GetRawBlock ∷ BlockComponent blk ByteString | |
GetHeader ∷ BlockComponent blk (Header blk) | |
GetRawHeader ∷ BlockComponent blk ByteString | |
GetHash ∷ BlockComponent blk (HeaderHash blk) | |
GetSlot ∷ BlockComponent blk SlotNo | |
GetIsEBB ∷ BlockComponent blk IsEBB | |
GetBlockSize ∷ BlockComponent blk SizeInBytes | |
GetHeaderSize ∷ BlockComponent blk Word16 | |
GetNestedCtxt ∷ BlockComponent blk (SomeSecond (NestedCtxt Header) blk) | |
GetPure ∷ a → BlockComponent blk a | |
GetApply ∷ BlockComponent blk (a → b) → BlockComponent blk a → BlockComponent blk b |
Instances
Applicative (BlockComponent blk) Source # | |
Defined in Ouroboros.Consensus.Storage.Common pure ∷ a → BlockComponent blk a # (<*>) ∷ BlockComponent blk (a → b) → BlockComponent blk a → BlockComponent blk b # liftA2 ∷ (a → b → c) → BlockComponent blk a → BlockComponent blk b → BlockComponent blk c # (*>) ∷ BlockComponent blk a → BlockComponent blk b → BlockComponent blk b # (<*) ∷ BlockComponent blk a → BlockComponent blk b → BlockComponent blk a # | |
Functor (BlockComponent blk) Source # | |
Defined in Ouroboros.Consensus.Storage.Common fmap ∷ (a → b) → BlockComponent blk a → BlockComponent blk b # (<$) ∷ a → BlockComponent blk b → BlockComponent blk a # |
Re-exports
data SizeInBytes Source #