cardano-ledger-binary-1.10.0.0: Binary serialization library used throughout ledger
Safe HaskellNone
LanguageHaskell2010

Test.Cardano.Ledger.Binary.Vintage.Helpers

Synopsis

Documentation

Binary test helpers

data U Source #

Instances

Instances details
Arbitrary U Source # 
Instance details

Defined in Test.Cardano.Ledger.Binary.Vintage.Helpers

Methods

arbitrary ∷ Gen U Source #

shrink ∷ U → [U] Source #

DecCBOR U Source # 
Instance details

Defined in Test.Cardano.Ledger.Binary.Vintage.Helpers

Methods

decCBOR ∷ Decoder s U Source #

dropCBOR ∷ Proxy U → Decoder s () Source #

label ∷ Proxy U → Text Source #

EncCBOR U Source # 
Instance details

Defined in Test.Cardano.Ledger.Binary.Vintage.Helpers

Methods

encCBOR ∷ U → Encoding Source #

Show U Source # 
Instance details

Defined in Test.Cardano.Ledger.Binary.Vintage.Helpers

Methods

showsPrec ∷ Int → U → ShowS #

show ∷ U → String #

showList ∷ [U] → ShowS #

Eq U Source # 
Instance details

Defined in Test.Cardano.Ledger.Binary.Vintage.Helpers

Methods

(==) ∷ U → U → Bool #

(/=) ∷ U → U → Bool #

data U24 Source #

Like U, but we expect to read back the Cbor Data Item when decoding.

Instances

Instances details
DecCBOR U24 Source # 
Instance details

Defined in Test.Cardano.Ledger.Binary.Vintage.Helpers

EncCBOR U24 Source # 
Instance details

Defined in Test.Cardano.Ledger.Binary.Vintage.Helpers

Methods

encCBOR ∷ U24 → Encoding Source #

Show U24 Source # 
Instance details

Defined in Test.Cardano.Ledger.Binary.Vintage.Helpers

Methods

showsPrec ∷ Int → U24 → ShowS #

show ∷ U24 → String #

showList ∷ [U24] → ShowS #

Eq U24 Source # 
Instance details

Defined in Test.Cardano.Ledger.Binary.Vintage.Helpers

Methods

(==) ∷ U24 → U24 → Bool #

(/=) ∷ U24 → U24 → Bool #

extensionProperty ∷ (Arbitrary a, Eq a, Show a, DecCBOR a, EncCBOR a) ⇒ Property Source #

Given a data type which can be extended, verify we can indeed do so without breaking anything. This should work with every time which adopted the schema of having at least one constructor of the form: .... | Unknown Word8 ByteString

cborFlatTermValid ∷ EncCBOR a ⇒ a → Property Source #

Machinery to test we perform "flat" encoding.