Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose new module Test.Gen.Cardano.Api.ProtocolParameters #369

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions cardano-api-gen/cardano-api-gen.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ library
hs-source-dirs: src
-- These modules should match those in cardano-api:gen
exposed-modules: Test.Gen.Cardano.Api.Empty
reexported-modules: Test.Gen.Cardano.Api,
Test.Gen.Cardano.Api.Metadata,
Test.Gen.Cardano.Api.Typed,
Test.Gen.Cardano.Crypto.Seed,
Test.Hedgehog.Golden.ErrorMessage,
Test.Hedgehog.Roundtrip.Bech32,
Test.Hedgehog.Roundtrip.CBOR,
reexported-modules: Test.Gen.Cardano.Api
, Test.Gen.Cardano.Api.Metadata
, Test.Gen.Cardano.Api.ProtocolParameters
, Test.Gen.Cardano.Api.Typed
, Test.Gen.Cardano.Crypto.Seed
, Test.Hedgehog.Golden.ErrorMessage
, Test.Hedgehog.Roundtrip.Bech32
, Test.Hedgehog.Roundtrip.CBOR
3 changes: 2 additions & 1 deletion cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ library gen
Test.Gen.Cardano.Api.Era
Test.Gen.Cardano.Api.Metadata
Test.Gen.Cardano.Api.Typed
Test.Gen.Cardano.Api.ProtocolParameters
Test.Gen.Cardano.Crypto.Seed
Test.Hedgehog.Golden.ErrorMessage
Test.Hedgehog.Roundtrip.Bech32
Expand All @@ -261,7 +262,7 @@ library gen
, cardano-binary >= 1.6 && < 1.8
, cardano-crypto-class ^>= 2.1.2
, cardano-crypto-test ^>= 1.5
, cardano-ledger-alonzo:{cardano-ledger-alonzo} >= 1.5.0
, cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib} >= 1.5.0
, cardano-ledger-byron-test >= 1.5
, cardano-ledger-core:{cardano-ledger-core, testlib} >= 1.8.0
, cardano-ledger-shelley >= 1.7.0
Expand Down
9 changes: 8 additions & 1 deletion cardano-api/gen/Test/Gen/Cardano/Api/ProtocolParameters.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ genCommonProtocolParametersUpdate =
<*> genStrictMaybe Q.arbitrary
<*> genStrictMaybe Q.arbitrary
<*> genStrictMaybe Q.arbitrary
<*> genStrictMaybe Q.arbitrary

genDeprecatedAfterMaryPParams :: MonadGen m => m (DeprecatedAfterMaryPParams era)
genDeprecatedAfterMaryPParams = DeprecatedAfterMaryPParams <$> genStrictMaybe Q.arbitrary

genDeprecatedAfterBabbagePParams :: MonadGen m => m (DeprecatedAfterBabbagePParams era)
genDeprecatedAfterBabbagePParams = DeprecatedAfterBabbagePParams <$> genStrictMaybe Q.arbitrary

genShelleyToAlonzoPParams :: MonadGen m => m (ShelleyToAlonzoPParams era)
genShelleyToAlonzoPParams =
ShelleyToAlonzoPParams
Expand Down Expand Up @@ -79,6 +81,7 @@ genShelleyEraBasedProtocolParametersUpdate =
ShelleyEraBasedProtocolParametersUpdate
<$> genCommonProtocolParametersUpdate
<*> genDeprecatedAfterMaryPParams
<*> genDeprecatedAfterBabbagePParams
<*> genShelleyToAlonzoPParams

genAllegraEraBasedProtocolParametersUpdate :: MonadGen m => m (EraBasedProtocolParametersUpdate AllegraEra)
Expand All @@ -87,26 +90,30 @@ genAllegraEraBasedProtocolParametersUpdate =
<$> genCommonProtocolParametersUpdate
<*> genDeprecatedAfterMaryPParams
<*> genShelleyToAlonzoPParams
<*> genDeprecatedAfterBabbagePParams

genMaryEraBasedProtocolParametersUpdate :: MonadGen m => m (EraBasedProtocolParametersUpdate MaryEra)
genMaryEraBasedProtocolParametersUpdate =
MaryEraBasedProtocolParametersUpdate
<$> genCommonProtocolParametersUpdate
<*> genDeprecatedAfterMaryPParams
<*> genShelleyToAlonzoPParams
<*> genDeprecatedAfterBabbagePParams

genAlonzoEraBasedProtocolParametersUpdate :: MonadGen m => m (EraBasedProtocolParametersUpdate AlonzoEra)
genAlonzoEraBasedProtocolParametersUpdate =
AlonzoEraBasedProtocolParametersUpdate
<$> genCommonProtocolParametersUpdate
<*> genShelleyToAlonzoPParams
<*> genAlonzoOnwardsPParams
<*> genDeprecatedAfterBabbagePParams

genBabbageEraBasedProtocolParametersUpdate :: MonadGen m => m (EraBasedProtocolParametersUpdate BabbageEra)
genBabbageEraBasedProtocolParametersUpdate =
BabbageEraBasedProtocolParametersUpdate
<$> genCommonProtocolParametersUpdate
<*> genAlonzoOnwardsPParams
<*> genDeprecatedAfterBabbagePParams
<*> genIntroducedInBabbagePParams

genConwayEraBasedProtocolParametersUpdate :: MonadGen m => m (EraBasedProtocolParametersUpdate ConwayEra)
Expand Down