ouroboros-consensus:unstable-cardano-testlib
Safe HaskellNone
LanguageHaskell2010

Test.Consensus.Cardano.GenTxIdBuilders

Description

Build Cardano OneEraGenTxId values from raw hash bytes, one per era.

Shared by the txid Eq/Ord benchmark and the txid Eq/Ord equivalence test: both need to place a chosen 32-byte hash at a chosen era position, without going through the network or the ledger.

Synopsis

Documentation

class BuildGenTxId blk where Source #

Build a transaction id for one era from raw hash bytes. Each era wraps its hash differently, hence one instance per era shape.

Instances

Instances details
BuildGenTxId ByronBlock Source # 
Instance details

Defined in Test.Consensus.Cardano.GenTxIdBuilders

Methods

buildGenTxId ∷ ShortByteString → GenTxId ByronBlock Source #

BuildGenTxId (ShelleyBlock proto era) Source # 
Instance details

Defined in Test.Consensus.Cardano.GenTxIdBuilders

Methods

buildGenTxId ∷ ShortByteString → GenTxId (ShelleyBlock proto era) Source #

apInjs ∷ ∀ (xs ∷ [Type]) (f ∷ Type → Type). SListI xs ⇒ NP f xs → [NS f xs] Source #

Inject each leaf into the sum at its own era position. The strict NS has no apInjs_NP, so we go through injections.

buildNP ∷ ∀ (xs ∷ [Type]). All BuildGenTxId xs ⇒ ShortByteString → NP WrapGenTxId xs Source #

One leaf per era, every era sharing the given hash bytes.

oneEraGenTxIds ∷ ∀ (xs ∷ [Type]). All BuildGenTxId xs ⇒ ShortByteString → [OneEraGenTxId xs] Source #

One OneEraGenTxId per era, list index equal to the era position, every entry carrying the given hash bytes.