ouroboros-consensus-cardano-0.20.0.0: The instantation of the Ouroboros consensus layer used by Cardano
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Consensus.Shelley.Generators

Synopsis

Documentation

data SomeResult blk where Source #

To easily generate all the possible results of the Query GADT, we introduce an existential that also bundles the corresponding Query as evidence. We also capture Eq, Show, and Typeable constraints, as we need them in the tests.

Constructors

SomeResult ∷ ∀ result blk. (Eq result, Show result, Typeable result) ⇒ BlockQuery blk result → result → SomeResult blk 

Instances

Instances details
CanMock proto era ⇒ Arbitrary (SomeResult (ShelleyBlock proto era)) Source # 
Instance details

Defined in Test.Consensus.Shelley.Generators

Methods

arbitraryGen (SomeResult (ShelleyBlock proto era)) Source #

shrinkSomeResult (ShelleyBlock proto era) → [SomeResult (ShelleyBlock proto era)] Source #

Show (SomeResult blk) 
Instance details

Defined in Test.Util.Serialisation.SomeResult

Methods

showsPrecIntSomeResult blk → ShowS #

showSomeResult blk → String #

showList ∷ [SomeResult blk] → ShowS #

Eq (SomeResult blk) 
Instance details

Defined in Test.Util.Serialisation.SomeResult

Methods

(==)SomeResult blk → SomeResult blk → Bool #

(/=)SomeResult blk → SomeResult blk → Bool #

Orphan instances

Arbitrary ShelleyTransition Source # 
Instance details

Arbitrary ShelleyNodeToClientVersion Source # 
Instance details

Arbitrary ShelleyNodeToNodeVersion Source # 
Instance details

PraosCrypto c ⇒ Arbitrary (ChainDepState c) Source # 
Instance details

(CanMock (Praos crypto) era, crypto ~ EraCrypto era) ⇒ Arbitrary (Header (ShelleyBlock (Praos crypto) era)) Source # 
Instance details

Methods

arbitraryGen (Header (ShelleyBlock (Praos crypto) era)) Source #

shrinkHeader (ShelleyBlock (Praos crypto) era) → [Header (ShelleyBlock (Praos crypto) era)] Source #

(CanMock (TPraos crypto) era, crypto ~ EraCrypto era) ⇒ Arbitrary (Header (ShelleyBlock (TPraos crypto) era)) Source # 
Instance details

Methods

arbitraryGen (Header (ShelleyBlock (TPraos crypto) era)) Source #

shrinkHeader (ShelleyBlock (TPraos crypto) era) → [Header (ShelleyBlock (TPraos crypto) era)] Source #

CanMock proto era ⇒ Arbitrary (AnnTip (ShelleyBlock proto era)) Source # 
Instance details

Methods

arbitraryGen (AnnTip (ShelleyBlock proto era)) Source #

shrinkAnnTip (ShelleyBlock proto era) → [AnnTip (ShelleyBlock proto era)] Source #

CanMock proto era ⇒ Arbitrary (LedgerState (ShelleyBlock proto era)) Source # 
Instance details

Methods

arbitraryGen (LedgerState (ShelleyBlock proto era)) Source #

shrinkLedgerState (ShelleyBlock proto era) → [LedgerState (ShelleyBlock proto era)] Source #

CanMock proto era ⇒ Arbitrary (GenTx (ShelleyBlock proto era)) Source # 
Instance details

Methods

arbitraryGen (GenTx (ShelleyBlock proto era)) Source #

shrinkGenTx (ShelleyBlock proto era) → [GenTx (ShelleyBlock proto era)] Source #

CanMock proto era ⇒ Arbitrary (GenTxId (ShelleyBlock proto era)) Source # 
Instance details

Methods

arbitraryGen (GenTxId (ShelleyBlock proto era)) Source #

shrinkGenTxId (ShelleyBlock proto era) → [GenTxId (ShelleyBlock proto era)] Source #

(CanMock (Praos crypto) era, crypto ~ EraCrypto era) ⇒ Arbitrary (Coherent (ShelleyBlock (Praos crypto) era)) Source #

Create a coherent Praos block

TODO Establish a coherent block without doing this translation from a TPraos header.

Instance details

Methods

arbitraryGen (Coherent (ShelleyBlock (Praos crypto) era)) Source #

shrinkCoherent (ShelleyBlock (Praos crypto) era) → [Coherent (ShelleyBlock (Praos crypto) era)] Source #

(CanMock (TPraos crypto) era, crypto ~ EraCrypto era) ⇒ Arbitrary (Coherent (ShelleyBlock (TPraos crypto) era)) Source #

This uses a different upstream generator to ensure the header and block body relate as expected.

Instance details

Methods

arbitraryGen (Coherent (ShelleyBlock (TPraos crypto) era)) Source #

shrinkCoherent (ShelleyBlock (TPraos crypto) era) → [Coherent (ShelleyBlock (TPraos crypto) era)] Source #

CanMock proto era ⇒ Arbitrary (SomeResult (ShelleyBlock proto era)) Source # 
Instance details

Methods

arbitraryGen (SomeResult (ShelleyBlock proto era)) Source #

shrinkSomeResult (ShelleyBlock proto era) → [SomeResult (ShelleyBlock proto era)] Source #

PraosCrypto c ⇒ Arbitrary (NonMyopicMemberRewards c) Source # 
Instance details

Mock c ⇒ Arbitrary (ShelleyHash c) Source # 
Instance details

PraosCrypto c ⇒ Arbitrary (TPraosState c) Source # 
Instance details

CanMock proto era ⇒ Arbitrary (WithVersion ShelleyNodeToClientVersion (SomeSecond BlockQuery (ShelleyBlock proto era))) Source #

Some Querys are only supported by ShelleyNodeToClientVersion2, so we make sure to not generate those queries in combination with ShelleyNodeToClientVersion1.

Instance details

(PraosCrypto crypto, CanMock (Praos crypto) era, crypto ~ EraCrypto era) ⇒ Arbitrary (ShelleyBlock (Praos crypto) era) Source # 
Instance details

Methods

arbitraryGen (ShelleyBlock (Praos crypto) era) Source #

shrinkShelleyBlock (Praos crypto) era → [ShelleyBlock (Praos crypto) era] Source #

(CanMock (TPraos crypto) era, crypto ~ EraCrypto era) ⇒ Arbitrary (ShelleyBlock (TPraos crypto) era) Source #

The upstream Arbitrary instance for Shelley blocks does not generate coherent blocks, so neither does this.

Instance details

Methods

arbitraryGen (ShelleyBlock (TPraos crypto) era) Source #

shrinkShelleyBlock (TPraos crypto) era → [ShelleyBlock (TPraos crypto) era] Source #

CanMock proto era ⇒ Arbitrary (ShelleyTip proto era) Source # 
Instance details

Methods

arbitraryGen (ShelleyTip proto era) Source #

shrinkShelleyTip proto era → [ShelleyTip proto era] Source #

CanMock proto era ⇒ Arbitrary (Point (ShelleyBlock proto era)) Source # 
Instance details

Methods

arbitraryGen (Point (ShelleyBlock proto era)) Source #

shrinkPoint (ShelleyBlock proto era) → [Point (ShelleyBlock proto era)] Source #

ShelleyBasedEra era ⇒ Arbitrary (SomeSecond (NestedCtxt f) (ShelleyBlock proto era)) Source # 
Instance details

CanMock proto era ⇒ Arbitrary (SomeSecond BlockQuery (ShelleyBlock proto era)) Source # 
Instance details