Skip to content

Commit

Permalink
Work in progress 2 (will undo)
Browse files Browse the repository at this point in the history
  • Loading branch information
palas committed Feb 26, 2024
1 parent 3e5dfe8 commit 2ea50ed
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 36 deletions.
74 changes: 40 additions & 34 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -19,47 +19,53 @@ index-state:
packages:
cardano-api
cardano-api-gen
../cardano-ledger/eras/alonzo/impl
../cardano-ledger/eras/babbage/impl
../cardano-ledger/eras/shelley/impl
../cardano-ledger/eras/conway/impl
../cardano-ledger/libs/cardano-ledger-core

package cardano-api
ghc-options: -Werror

package cardano-api-gen
ghc-options: -Werror

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-ledger.git
tag: 504253f1eb4b05158ff2df51ac0a22725a4e4a95
subdir: eras/alonzo/impl
--sha256: sha256-xa5Dl2GEj6Q1bAPqjyAZAQDkINXdcYs2lPMsyLOVxbM=

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-ledger.git
tag: 504253f1eb4b05158ff2df51ac0a22725a4e4a95
subdir: eras/babbage/impl
--sha256: sha256-xa5Dl2GEj6Q1bAPqjyAZAQDkINXdcYs2lPMsyLOVxbM=

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-ledger.git
tag: 504253f1eb4b05158ff2df51ac0a22725a4e4a95
subdir: eras/shelley/impl
--sha256: sha256-xa5Dl2GEj6Q1bAPqjyAZAQDkINXdcYs2lPMsyLOVxbM=

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-ledger.git
tag: 504253f1eb4b05158ff2df51ac0a22725a4e4a95
subdir: eras/conway/impl
--sha256: sha256-xa5Dl2GEj6Q1bAPqjyAZAQDkINXdcYs2lPMsyLOVxbM=

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-ledger.git
tag: 504253f1eb4b05158ff2df51ac0a22725a4e4a95
subdir: libs/cardano-ledger-core
--sha256: sha256-xa5Dl2GEj6Q1bAPqjyAZAQDkINXdcYs2lPMsyLOVxbM=

-- source-repository-package
-- type: git
-- location: https://github.com/IntersectMBO/cardano-ledger.git
-- tag: 504253f1eb4b05158ff2df51ac0a22725a4e4a95
-- subdir: eras/alonzo/impl
-- --sha256: sha256-xa5Dl2GEj6Q1bAPqjyAZAQDkINXdcYs2lPMsyLOVxbM=

-- source-repository-package
-- type: git
-- location: https://github.com/IntersectMBO/cardano-ledger.git
-- tag: 504253f1eb4b05158ff2df51ac0a22725a4e4a95
-- subdir: eras/babbage/impl
-- --sha256: sha256-xa5Dl2GEj6Q1bAPqjyAZAQDkINXdcYs2lPMsyLOVxbM=

-- source-repository-package
-- type: git
-- location: https://github.com/IntersectMBO/cardano-ledger.git
-- tag: 504253f1eb4b05158ff2df51ac0a22725a4e4a95
-- subdir: eras/shelley/impl
-- --sha256: sha256-xa5Dl2GEj6Q1bAPqjyAZAQDkINXdcYs2lPMsyLOVxbM=

-- source-repository-package
-- type: git
-- location: https://github.com/IntersectMBO/cardano-ledger.git
-- tag: 504253f1eb4b05158ff2df51ac0a22725a4e4a95
-- subdir: eras/conway/impl
-- --sha256: sha256-xa5Dl2GEj6Q1bAPqjyAZAQDkINXdcYs2lPMsyLOVxbM=

-- source-repository-package
-- type: git
-- location: https://github.com/IntersectMBO/cardano-ledger.git
-- tag: 504253f1eb4b05158ff2df51ac0a22725a4e4a95
-- subdir: libs/cardano-ledger-core
-- --sha256: sha256-xa5Dl2GEj6Q1bAPqjyAZAQDkINXdcYs2lPMsyLOVxbM=



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Test.Cardano.Api.ProtocolParameters(tests) where

import Cardano.Api.Ledger (PParams(..))
import Cardano.Api.ProtocolParameters (ProtocolParameters (..), convertToLedgerProtocolParameters, LedgerProtocolParameters (..))
import Hedgehog (Property, property, forAll, (===), Gen, success)
import Hedgehog (Property, property, forAll, (===), Gen, success, footnote)
import Cardano.Api (CardanoEra (..), inEonForEra, ToJSON, prettyPrintJSON, ProtocolParametersConversionError, FromJSON)
import Cardano.Api.Eon.ShelleyBasedEra(ShelleyBasedEra(..), ShelleyLedgerEra)
import Test.Gen.Cardano.Api.Typed (genProtocolParameters)
Expand Down Expand Up @@ -36,7 +36,8 @@ protocolParametersSerializeTheSame era =
let protocolParametersBS = prettyPrintJSON protocolParameters :: ByteString
case convertToEraAndSerialize protocolParameters of
Left _ -> success -- fail (show err)
Right pParamsBS -> pParamsBS === protocolParametersBS
Right pParamsBS -> do footnote $ "Decentralization parameter was: " <> show (protocolParamDecentralization protocolParameters)
pParamsBS === protocolParametersBS
where
convertToEraAndSerialize :: ProtocolParameters -> Either ProtocolParametersConversionError ByteString
convertToEraAndSerialize pp =
Expand Down

0 comments on commit 2ea50ed

Please sign in to comment.