Skip to content

Commit

Permalink
Disable cost model generation in testing because the JSON instances are
Browse files Browse the repository at this point in the history
now asymmetric
  • Loading branch information
Jimbo4350 committed May 20, 2022
1 parent 42f97cd commit b6a6851
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions cardano-api/gen/Gen/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ genCostModels = do
genAlonzoGenesis :: Gen Alonzo.AlonzoGenesis
genAlonzoGenesis = do
coinsPerUTxOWord <- genCoin (Range.linear 0 5)
costmdls' <- genCostModels
-- TODO: Babbage: Figure out how to deal with the asymmetric cost model JSON
_costmdls' <- genCostModels
prices' <- genPrices
maxTxExUnits' <- genExUnits
maxBlockExUnits' <- genExUnits
Expand All @@ -113,7 +114,7 @@ genAlonzoGenesis = do

return Alonzo.AlonzoGenesis
{ Alonzo.coinsPerUTxOWord = coinsPerUTxOWord
, Alonzo.costmdls = costmdls'
, Alonzo.costmdls = Alonzo.CostModels mempty
, Alonzo.prices = prices'
, Alonzo.maxTxExUnits = maxTxExUnits'
, Alonzo.maxBlockExUnits = maxBlockExUnits'
Expand Down
12 changes: 8 additions & 4 deletions cardano-api/gen/Gen/Cardano/Api/Typed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,9 @@ genProtocolParameters =
<*> genRational
<*> genRational
<*> Gen.maybe genLovelace
<*> genCostModels
<*> return mempty
--TODO: Babbage figure out how to deal with
-- asymmetric cost model JSON instances
<*> Gen.maybe genExecutionUnitPrices
<*> Gen.maybe genExecutionUnits
<*> Gen.maybe genExecutionUnits
Expand Down Expand Up @@ -783,7 +785,9 @@ genProtocolParametersUpdate = do
protocolUpdateMonetaryExpansion <- Gen.maybe genRational
protocolUpdateTreasuryCut <- Gen.maybe genRational
protocolUpdateUTxOCostPerWord <- Gen.maybe genLovelace
protocolUpdateCostModels <- genCostModels
protocolUpdateCostModels <- return mempty -- genCostModels
--TODO: Babbage figure out how to deal with
-- asymmetric cost model JSON instances
protocolUpdatePrices <- Gen.maybe genExecutionUnitPrices
protocolUpdateMaxTxExUnits <- Gen.maybe genExecutionUnits
protocolUpdateMaxBlockExUnits <- Gen.maybe genExecutionUnits
Expand Down Expand Up @@ -814,8 +818,8 @@ genCostModel = case Plutus.defaultCostModelParams of
genPlutusLanguage :: Gen Language
genPlutusLanguage = Gen.element [PlutusV1, PlutusV2]

genCostModels :: Gen (Map AnyPlutusScriptVersion CostModel)
genCostModels =
_genCostModels :: Gen (Map AnyPlutusScriptVersion CostModel)
_genCostModels =
Gen.map (Range.linear 0 (length plutusScriptVersions))
((,) <$> Gen.element plutusScriptVersions
<*> genCostModel)
Expand Down

0 comments on commit b6a6851

Please sign in to comment.