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

Test.Consensus.Shelley.Generators

Documentation

data SomeResult blk where #

Constructors

SomeResult :: forall 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)) 
Instance details

Defined in Test.Consensus.Shelley.Generators

Methods

arbitrary :: Gen (SomeResult (ShelleyBlock proto era))

shrink :: SomeResult (ShelleyBlock proto era) -> [SomeResult (ShelleyBlock proto era)]

Show (SomeResult blk) 
Instance details

Defined in Test.Util.Serialisation.SomeResult

Eq (SomeResult blk) 
Instance details

Defined in Test.Util.Serialisation.SomeResult

Methods

(==) :: SomeResult blk -> SomeResult blk -> Bool Source #

(/=) :: SomeResult blk -> SomeResult blk -> Bool Source #

Orphan instances

Arbitrary ShelleyTransition Source # 
Instance details

Methods

arbitrary :: Gen ShelleyTransition

shrink :: ShelleyTransition -> [ShelleyTransition]

Arbitrary ShelleyNodeToClientVersion Source # 
Instance details

Methods

arbitrary :: Gen ShelleyNodeToClientVersion

shrink :: ShelleyNodeToClientVersion -> [ShelleyNodeToClientVersion]

Arbitrary ShelleyNodeToNodeVersion Source # 
Instance details

Methods

arbitrary :: Gen ShelleyNodeToNodeVersion

shrink :: ShelleyNodeToNodeVersion -> [ShelleyNodeToNodeVersion]

PraosCrypto c => Arbitrary (ChainDepState c) Source # 
Instance details

Methods

arbitrary :: Gen (ChainDepState c)

shrink :: ChainDepState c -> [ChainDepState c]

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

Methods

arbitrary :: Gen (Header (ShelleyBlock (Praos crypto) era))

shrink :: Header (ShelleyBlock (Praos crypto) era) -> [Header (ShelleyBlock (Praos crypto) era)]

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

Methods

arbitrary :: Gen (Header (ShelleyBlock (TPraos crypto) era))

shrink :: Header (ShelleyBlock (TPraos crypto) era) -> [Header (ShelleyBlock (TPraos crypto) era)]

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

Methods

arbitrary :: Gen (AnnTip (ShelleyBlock proto era))

shrink :: AnnTip (ShelleyBlock proto era) -> [AnnTip (ShelleyBlock proto era)]

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

Methods

arbitrary :: Gen (LedgerState (ShelleyBlock proto era))

shrink :: LedgerState (ShelleyBlock proto era) -> [LedgerState (ShelleyBlock proto era)]

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

Methods

arbitrary :: Gen (GenTx (ShelleyBlock proto era))

shrink :: GenTx (ShelleyBlock proto era) -> [GenTx (ShelleyBlock proto era)]

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

Methods

arbitrary :: Gen (GenTxId (ShelleyBlock proto era))

shrink :: GenTxId (ShelleyBlock proto era) -> [GenTxId (ShelleyBlock proto era)]

(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

arbitrary :: Gen (Coherent (ShelleyBlock (Praos crypto) era))

shrink :: Coherent (ShelleyBlock (Praos crypto) era) -> [Coherent (ShelleyBlock (Praos crypto) era)]

(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

arbitrary :: Gen (Coherent (ShelleyBlock (TPraos crypto) era))

shrink :: Coherent (ShelleyBlock (TPraos crypto) era) -> [Coherent (ShelleyBlock (TPraos crypto) era)]

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

Methods

arbitrary :: Gen (SomeResult (ShelleyBlock proto era))

shrink :: SomeResult (ShelleyBlock proto era) -> [SomeResult (ShelleyBlock proto era)]

PraosCrypto c => Arbitrary (NonMyopicMemberRewards c) Source # 
Instance details

Methods

arbitrary :: Gen (NonMyopicMemberRewards c)

shrink :: NonMyopicMemberRewards c -> [NonMyopicMemberRewards c]

Mock c => Arbitrary (ShelleyHash c) Source # 
Instance details

Methods

arbitrary :: Gen (ShelleyHash c)

shrink :: ShelleyHash c -> [ShelleyHash c]

PraosCrypto c => Arbitrary (TPraosState c) Source # 
Instance details

Methods

arbitrary :: Gen (TPraosState c)

shrink :: TPraosState c -> [TPraosState c]

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

Methods

arbitrary :: Gen (SomeSecond (NestedCtxt f) (ShelleyBlock proto era))

shrink :: SomeSecond (NestedCtxt f) (ShelleyBlock proto era) -> [SomeSecond (NestedCtxt f) (ShelleyBlock proto era)]

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

Methods

arbitrary :: Gen (SomeSecond BlockQuery (ShelleyBlock proto era))

shrink :: SomeSecond BlockQuery (ShelleyBlock proto era) -> [SomeSecond BlockQuery (ShelleyBlock proto era)]

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

Methods

arbitrary :: Gen (WithVersion ShelleyNodeToClientVersion (SomeSecond BlockQuery (ShelleyBlock proto era)))

shrink :: WithVersion ShelleyNodeToClientVersion (SomeSecond BlockQuery (ShelleyBlock proto era)) -> [WithVersion ShelleyNodeToClientVersion (SomeSecond BlockQuery (ShelleyBlock proto era))]

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

Methods

arbitrary :: Gen (ShelleyBlock (Praos crypto) era)

shrink :: ShelleyBlock (Praos crypto) era -> [ShelleyBlock (Praos crypto) era]

(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

arbitrary :: Gen (ShelleyBlock (TPraos crypto) era)

shrink :: ShelleyBlock (TPraos crypto) era -> [ShelleyBlock (TPraos crypto) era]

CanMock proto era => Arbitrary (ShelleyTip proto era) Source # 
Instance details

Methods

arbitrary :: Gen (ShelleyTip proto era)

shrink :: ShelleyTip proto era -> [ShelleyTip proto era]

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

Methods

arbitrary :: Gen (Point (ShelleyBlock proto era))

shrink :: Point (ShelleyBlock proto era) -> [Point (ShelleyBlock proto era)]