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

Remove ProtocolParameters #729

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
3 changes: 0 additions & 3 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ test-suite cardano-api-test
Test.Cardano.Api.Metadata
Test.Cardano.Api.Ord
Test.Cardano.Api.Orphans
Test.Cardano.Api.ProtocolParameters
Test.Cardano.Api.RawBytes
Test.Cardano.Api.Transaction.Autobalance
Test.Cardano.Api.TxBody
Expand Down Expand Up @@ -396,7 +395,6 @@ test-suite cardano-api-golden
cardano-data >=1.0,
cardano-ledger-alonzo,
cardano-ledger-api ^>=1.9,
cardano-ledger-babbage >=1.9,
cardano-ledger-binary,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.14,
cardano-ledger-shelley,
Expand Down Expand Up @@ -425,7 +423,6 @@ test-suite cardano-api-golden
other-modules:
Test.Golden.Cardano.Api.Genesis
Test.Golden.Cardano.Api.Ledger
Test.Golden.Cardano.Api.ProtocolParameters
Test.Golden.Cardano.Api.Script
Test.Golden.Cardano.Api.Value
Test.Golden.ErrorsSpec
34 changes: 0 additions & 34 deletions cardano-api/gen/Test/Gen/Cardano/Api/Typed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ module Test.Gen.Cardano.Api.Typed
, genMaybePraosNonce
, genPraosNonce
, genValidProtocolParameters
, genProtocolParameters
, genValueNestedRep
, genValueNestedBundle
, genByronKeyWitness
Expand Down Expand Up @@ -990,39 +989,6 @@ genPraosNonce = makePraosNonce <$> Gen.bytes (Range.linear 0 32)
genMaybePraosNonce :: Gen (Maybe PraosNonce)
genMaybePraosNonce = Gen.maybe genPraosNonce

genProtocolParameters :: CardanoEra era -> Gen ProtocolParameters
genProtocolParameters era = do
protocolParamProtocolVersion <- (,) <$> genNat <*> genNat
protocolParamDecentralization <- Gen.maybe genRational
protocolParamExtraPraosEntropy <- genMaybePraosNonce
protocolParamMaxBlockHeaderSize <- genNat
protocolParamMaxBlockBodySize <- genNat
protocolParamMaxTxSize <- genNat
protocolParamTxFeeFixed <- genLovelace
protocolParamTxFeePerByte <- genLovelace
protocolParamMinUTxOValue <- Gen.maybe genLovelace
protocolParamStakeAddressDeposit <- genLovelace
protocolParamStakePoolDeposit <- genLovelace
protocolParamMinPoolCost <- genLovelace
protocolParamPoolRetireMaxEpoch <- genEpochInterval
protocolParamStakePoolTargetNum <- genNat
protocolParamPoolPledgeInfluence <- genRationalInt64
protocolParamMonetaryExpansion <- genRational
protocolParamTreasuryCut <- genRational
let protocolParamCostModels = mempty
-- TODO: Babbage figure out how to deal with
-- asymmetric cost model JSON instances
protocolParamPrices <- Gen.maybe genExecutionUnitPrices
protocolParamMaxTxExUnits <- Gen.maybe genExecutionUnits
protocolParamMaxBlockExUnits <- Gen.maybe genExecutionUnits
protocolParamMaxValueSize <- Gen.maybe genNat
protocolParamCollateralPercent <- Gen.maybe genNat
protocolParamMaxCollateralInputs <- Gen.maybe genNat
protocolParamUTxOCostPerByte <-
inEonForEra @BabbageEraOnwards (pure Nothing) (const (Just <$> genLovelace)) era

pure ProtocolParameters{..}

-- | Generate valid protocol parameters which pass validations in Cardano.Api.ProtocolParameters
genValidProtocolParameters :: ShelleyBasedEra era -> Gen (LedgerProtocolParameters era)
genValidProtocolParameters sbe = shelleyBasedEraTestConstraints sbe $ LedgerProtocolParameters <$> Q.arbitrary
Expand Down
Loading