consensus-test
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Util.TersePrinting

Description

Helpers for printing various objects in a terse way. Terse printing is similar to that provided by the Condense typeclass except it can be sometimes even more compact and it is very specific to tests.

Synopsis

Documentation

terseAnchorAnchor TestBlockString Source #

Same as tersePoint for anchors.

terseBlockTestBlockString Source #

Print a TestBlock as block-slot[hash]. hash only shows if there is a non-zero element in it. When it shows, it shows in a compact form. For instance, the hash [0,0,1,0,0,0] shows as [2x0,1,3x0].

terseFragmentAnchoredFragment TestBlockString Source #

Print a fragment of TestBlock in a terse way. This shows as anchor | block ... where anchor is printed with terseAnchor and blocks are printed with terseBlock'; in particular, only the last element of the hash shows and only when it is non-zero.

terseHFragmentAnchoredFragment (Header TestBlock) → String Source #

Same as terseFragment for fragments of headers.

terseHeaderHeader TestBlockString Source #

Same as terseBlock for headers.

terseMaybe ∷ (a → String) → Maybe a → String Source #

Same as terseWithOrigin for Maybe.

tersePointPoint TestBlockString Source #

Same as terseBlock for points. Genesis shows as G.

terseTipTip TestBlockString Source #

Same as tersePoint for tips.

terseWithOrigin ∷ (a → String) → WithOrigin a → String Source #

Given a printer for elements of type a, prints a WithOrigin a in a terse way. Origin shows as G.