From 883e1b969f63e40bf880fac44864ee579b735122 Mon Sep 17 00:00:00 2001 From: Lucsanszky Date: Fri, 19 Apr 2024 00:53:01 +0200 Subject: [PATCH] Use `StandardCrypto` in protocol info tests `exampleConwayGenesis` was made monomorphic here: https://github.com/IntersectMBO/cardano-ledger/pull/4252 The `Crypto c` constraint was removed and now it uses `StandardCrypto`. --- .../Test/Consensus/Cardano/ProtocolInfo.hs | 6 ++++-- .../test/cardano-test/Test/ThreadNet/Cardano.hs | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/ProtocolInfo.hs b/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/ProtocolInfo.hs index 2d020a4677..d3da203a3f 100644 --- a/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/ProtocolInfo.hs +++ b/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/ProtocolInfo.hs @@ -4,6 +4,7 @@ {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} -- | Utility functions to elaborate a Cardano 'ProtocolInfo' from certain parameters. module Test.Consensus.Cardano.ProtocolInfo ( @@ -23,6 +24,7 @@ module Test.Consensus.Cardano.ProtocolInfo ( import qualified Cardano.Chain.Genesis as CC.Genesis import qualified Cardano.Chain.Update as CC.Update +import Cardano.Ledger.Api.Era (StandardCrypto) import qualified Cardano.Ledger.Api.Transition as L import qualified Cardano.Ledger.BaseTypes as SL import qualified Cardano.Protocol.TPraos.OCert as SL @@ -177,7 +179,7 @@ hardForkInto Conway = -- mkSimpleTestProtocolInfo :: forall c - . CardanoHardForkConstraints c + . (CardanoHardForkConstraints c, c ~ StandardCrypto) => Shelley.DecentralizationParam -- ^ Network decentralization parameter. -> SecurityParam @@ -244,7 +246,7 @@ mkSimpleTestProtocolInfo -- mkTestProtocolInfo :: forall m c - . (CardanoHardForkConstraints c, IOLike m) + . (CardanoHardForkConstraints c, IOLike m, c ~ StandardCrypto) => (CoreNodeId, Shelley.CoreNode c) -- ^ Id of the node for which the protocol info will be elaborated. -> ShelleyGenesis c diff --git a/ouroboros-consensus-cardano/test/cardano-test/Test/ThreadNet/Cardano.hs b/ouroboros-consensus-cardano/test/cardano-test/Test/ThreadNet/Cardano.hs index 0db3b4901e..af64543dfa 100644 --- a/ouroboros-consensus-cardano/test/cardano-test/Test/ThreadNet/Cardano.hs +++ b/ouroboros-consensus-cardano/test/cardano-test/Test/ThreadNet/Cardano.hs @@ -5,6 +5,7 @@ {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} module Test.ThreadNet.Cardano (tests) where @@ -47,7 +48,6 @@ import Ouroboros.Consensus.Protocol.Praos.Translate () import Ouroboros.Consensus.Shelley.Ledger.SupportsProtocol () import Ouroboros.Consensus.Shelley.Node import Ouroboros.Consensus.Util.IOLike (IOLike) -import Test.Consensus.Cardano.MockCrypto (MockCryptoCompatByron) import Test.Consensus.Cardano.ProtocolInfo (HardForkSpec (..), mkTestProtocolInfo) import Test.QuickCheck @@ -73,7 +73,7 @@ import Test.Util.TestEnv -- | Use 'MockCryptoCompatByron' so that bootstrap addresses and -- bootstrap witnesses are supported. -type Crypto = MockCryptoCompatByron +type Crypto = StandardCrypto -- | The varying data of this test -- @@ -428,7 +428,7 @@ prop_simple_cardano_convergence TestSetup property $ maxRollbacks setupK >= finalIntersectionDepth mkProtocolCardanoAndHardForkTxs :: - forall c m. (IOLike m, CardanoHardForkConstraints c) + forall c m. (IOLike m, c ~ StandardCrypto) -- Byron => PBftParams -> CoreNodeId