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

Test.Consensus.Cardano.Generators

Description

Arbitrary instances intended for serialisation roundtrip tests for CardanoBlock and its related types.

Because the generated values are only used in serialisation roundtrip tests, they don't need to be valid blocks, transactions, etc.

We combine the Byron and Shelley-based instances defined elsewhere into Cardano instances by picking randomly from one of the eras.

Orphan instances

Arbitrary EraEnd Source # 
Instance details

Arbitrary EraSummary Source # 
Instance details

Arbitrary TriggerHardFork Source # 
Instance details

Arbitrary ByronPartialLedgerConfig Source # 
Instance details

Methods

arbitrary ∷ Gen ByronPartialLedgerConfig Source #

shrink ∷ ByronPartialLedgerConfig → [ByronPartialLedgerConfig] Source #

Arbitrary (EraIndex (CardanoEras c)) Source # 
Instance details

Methods

arbitrary ∷ Gen (EraIndex (CardanoEras c)) Source #

shrink ∷ EraIndex (CardanoEras c) → [EraIndex (CardanoEras c)] Source #

CardanoHardForkConstraints c ⇒ Arbitrary (PerEraLedgerConfig (CardanoEras c)) Source # 
Instance details

Methods

arbitrary ∷ Gen (PerEraLedgerConfig (CardanoEras c)) Source #

shrink ∷ PerEraLedgerConfig (CardanoEras c) → [PerEraLedgerConfig (CardanoEras c)] Source #

CardanoHardForkConstraints c ⇒ Arbitrary (HardForkLedgerConfig (CardanoEras c)) Source # 
Instance details

Methods

arbitrary ∷ Gen (HardForkLedgerConfig (CardanoEras c)) Source #

shrink ∷ HardForkLedgerConfig (CardanoEras c) → [HardForkLedgerConfig (CardanoEras c)] Source #

Arbitrary (BlockNodeToClientVersion blk) ⇒ Arbitrary (EraNodeToClientVersion blk) Source # 
Instance details

CardanoHardForkConstraints c ⇒ Arbitrary (HardForkNodeToClientVersion (CardanoEras c)) Source # 
Instance details

Methods

arbitrary ∷ Gen (HardForkNodeToClientVersion (CardanoEras c)) Source #

shrink ∷ HardForkNodeToClientVersion (CardanoEras c) → [HardForkNodeToClientVersion (CardanoEras c)] Source #

CardanoHardForkConstraints c ⇒ Arbitrary (HardForkNodeToNodeVersion (CardanoEras c)) Source # 
Instance details

Methods

arbitrary ∷ Gen (HardForkNodeToNodeVersion (CardanoEras c)) Source #

shrink ∷ HardForkNodeToNodeVersion (CardanoEras c) → [HardForkNodeToNodeVersion (CardanoEras c)] Source #

Arbitrary (PartialLedgerConfig blk) ⇒ Arbitrary (WrapPartialLedgerConfig blk) Source # 
Instance details

Arbitrary (Interpreter (CardanoEras c)) Source # 
Instance details

Methods

arbitrary ∷ Gen (Interpreter (CardanoEras c)) Source #

shrink ∷ Interpreter (CardanoEras c) → [Interpreter (CardanoEras c)] Source #

SListI xs ⇒ Arbitrary (Shape xs) Source # 
Instance details

Methods

arbitrary ∷ Gen (Shape xs) Source #

shrink ∷ Shape xs → [Shape xs] Source #

(c ~ StandardCrypto, ShelleyBasedEra ShelleyEra) ⇒ Arbitrary (AnnTip (CardanoBlock c)) Source # 
Instance details

Methods

arbitrary ∷ Gen (AnnTip (CardanoBlock c)) Source #

shrink ∷ AnnTip (CardanoBlock c) → [AnnTip (CardanoBlock c)] Source #

Arbitrary (BlockNodeToNodeVersion blk) ⇒ Arbitrary (WrapNodeToNodeVersion blk) Source # 
Instance details

Arbitrary (CardanoBlock StandardCrypto) Source # 
Instance details

Methods

arbitrary ∷ Gen (CardanoBlock StandardCrypto) Source #

shrink ∷ CardanoBlock StandardCrypto → [CardanoBlock StandardCrypto] Source #

Arbitrary (CardanoHeader StandardCrypto) Source # 
Instance details

Methods

arbitrary ∷ Gen (CardanoHeader StandardCrypto) Source #

shrink ∷ CardanoHeader StandardCrypto → [CardanoHeader StandardCrypto] Source #

Arbitrary (ShelleyLedgerConfig era) ⇒ Arbitrary (ShelleyPartialLedgerConfig era) Source # 
Instance details

Methods

arbitrary ∷ Gen (ShelleyPartialLedgerConfig era) Source #

shrink ∷ ShelleyPartialLedgerConfig era → [ShelleyPartialLedgerConfig era] Source #

Arbitrary (Coherent (CardanoBlock StandardCrypto)) Source # 
Instance details

Methods

arbitrary ∷ Gen (Coherent (CardanoBlock StandardCrypto)) Source #

shrink ∷ Coherent (CardanoBlock StandardCrypto) → [Coherent (CardanoBlock StandardCrypto)] Source #

(CanMock (TPraos c) ShelleyEra, CardanoHardForkConstraints c) ⇒ Arbitrary (OneEraHash (CardanoEras c)) Source # 
Instance details

Methods

arbitrary ∷ Gen (OneEraHash (CardanoEras c)) Source #

shrink ∷ OneEraHash (CardanoEras c) → [OneEraHash (CardanoEras c)] Source #

CardanoHardForkConstraints c ⇒ Arbitrary (WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (HardForkLedgerConfig (CardanoEras c))) Source #

See encodeNodeToClientNP and decodeNodeToClientNP.

Instance details

Methods

arbitrary ∷ Gen (WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (HardForkLedgerConfig (CardanoEras c))) Source #

shrink ∷ WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (HardForkLedgerConfig (CardanoEras c)) → [WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (HardForkLedgerConfig (CardanoEras c))] Source #

c ~ StandardCrypto ⇒ Arbitrary (WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (SomeBlockQuery (BlockQuery (CardanoBlock c)))) Source # 
Instance details

Methods

arbitrary ∷ Gen (WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (SomeBlockQuery (BlockQuery (CardanoBlock c)))) Source #

shrink ∷ WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (SomeBlockQuery (BlockQuery (CardanoBlock c))) → [WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (SomeBlockQuery (BlockQuery (CardanoBlock c)))] Source #

c ~ StandardCrypto ⇒ Arbitrary (WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (CardanoApplyTxErr c)) Source # 
Instance details

Methods

arbitrary ∷ Gen (WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (CardanoApplyTxErr c)) Source #

shrink ∷ WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (CardanoApplyTxErr c) → [WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (CardanoApplyTxErr c)] Source #

c ~ StandardCrypto ⇒ Arbitrary (WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (CardanoBlock c)) Source # 
Instance details

Methods

arbitrary ∷ Gen (WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (CardanoBlock c)) Source #

shrink ∷ WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (CardanoBlock c) → [WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (CardanoBlock c)] Source #

c ~ StandardCrypto ⇒ Arbitrary (WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (CardanoGenTx c)) Source # 
Instance details

Methods

arbitrary ∷ Gen (WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (CardanoGenTx c)) Source #

shrink ∷ WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (CardanoGenTx c) → [WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (CardanoGenTx c)] Source #

c ~ StandardCrypto ⇒ Arbitrary (WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (SomeResult (CardanoBlock c))) Source # 
Instance details

Methods

arbitrary ∷ Gen (WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (SomeResult (CardanoBlock c))) Source #

shrink ∷ WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (SomeResult (CardanoBlock c)) → [WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (SomeResult (CardanoBlock c))] Source #

CardanoHardForkConstraints c ⇒ Arbitrary (WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (Some (QueryHardFork (CardanoEras c)))) Source # 
Instance details

Methods

arbitrary ∷ Gen (WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (Some (QueryHardFork (CardanoEras c)))) Source #

shrink ∷ WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (Some (QueryHardFork (CardanoEras c))) → [WithVersion (HardForkNodeToClientVersion (CardanoEras c)) (Some (QueryHardFork (CardanoEras c)))] Source #

c ~ StandardCrypto ⇒ Arbitrary (WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (SomeSecond (NestedCtxt Header) (CardanoBlock c))) Source # 
Instance details

Methods

arbitrary ∷ Gen (WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (SomeSecond (NestedCtxt Header) (CardanoBlock c))) Source #

shrink ∷ WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (SomeSecond (NestedCtxt Header) (CardanoBlock c)) → [WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (SomeSecond (NestedCtxt Header) (CardanoBlock c))] Source #

c ~ StandardCrypto ⇒ Arbitrary (WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (CardanoBlock c)) Source # 
Instance details

Methods

arbitrary ∷ Gen (WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (CardanoBlock c)) Source #

shrink ∷ WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (CardanoBlock c) → [WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (CardanoBlock c)] Source #

c ~ StandardCrypto ⇒ Arbitrary (WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (CardanoGenTx c)) Source # 
Instance details

Methods

arbitrary ∷ Gen (WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (CardanoGenTx c)) Source #

shrink ∷ WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (CardanoGenTx c) → [WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (CardanoGenTx c)] Source #

c ~ StandardCrypto ⇒ Arbitrary (WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (CardanoGenTxId c)) Source # 
Instance details

Methods

arbitrary ∷ Gen (WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (CardanoGenTxId c)) Source #

shrink ∷ WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (CardanoGenTxId c) → [WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (CardanoGenTxId c)] Source #

c ~ StandardCrypto ⇒ Arbitrary (WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (CardanoHeader c)) Source # 
Instance details

Methods

arbitrary ∷ Gen (WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (CardanoHeader c)) Source #

shrink ∷ WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (CardanoHeader c) → [WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) (CardanoHeader c)] Source #

Arbitrary (Some QueryAnytime) Source # 
Instance details

(Arbitrary a, SListI xs) ⇒ Arbitrary (NonEmpty xs a) Source # 
Instance details

Methods

arbitrary ∷ Gen (NonEmpty xs a) Source #

shrink ∷ NonEmpty xs a → [NonEmpty xs a] Source #