Skip to content

Commit

Permalink
Use StandardCrypto in protocol info tests
Browse files Browse the repository at this point in the history
`exampleConwayGenesis` was made monomorphic here:
IntersectMBO/cardano-ledger#4252
The `Crypto c` constraint was removed and now it uses `StandardCrypto`.
  • Loading branch information
Lucsanszky committed Apr 24, 2024
1 parent e432c10 commit 4d2a152
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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
Expand Down Expand Up @@ -177,7 +179,7 @@ hardForkInto Conway =
--
mkSimpleTestProtocolInfo ::
forall c
. CardanoHardForkConstraints c
. (CardanoHardForkConstraints c, c ~ StandardCrypto)
=> Shelley.DecentralizationParam
-- ^ Network decentralization parameter.
-> SecurityParam
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}

module Test.ThreadNet.Cardano (tests) where

Expand Down Expand Up @@ -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
Expand All @@ -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
--
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4d2a152

Please sign in to comment.