Skip to content

Commit

Permalink
Merge pull request #369 from input-output-hk/ch/expose-protocol-param…
Browse files Browse the repository at this point in the history
…eters-generators

Leftover from #352: forgot to expose new module `Test.Gen.Cardano.Api.ProtocolParameters`
  • Loading branch information
carlhammann authored Nov 14, 2023
2 parents 65240dd + 1df547c commit 004ade6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
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

0 comments on commit 004ade6

Please sign in to comment.