11{-# LANGUAGE CPP #-}
22{-# LANGUAGE GeneralizedNewtypeDeriving #-}
3- {-# LANGUAGE LambdaCase #-}
43{-# LANGUAGE MultiParamTypeClasses #-}
54{-# LANGUAGE ScopedTypeVariables #-}
65{-# LANGUAGE StandaloneDeriving #-}
7- {-# LANGUAGE TypeApplications #-}
86{-# LANGUAGE TypeFamilies #-}
9- {-# LANGUAGE TypeOperators #-}
107{-# OPTIONS_GHC -Wno-orphans #-}
118
129module Test.Cardano.Ledger.Binary.Arbitrary (
@@ -17,9 +14,6 @@ module Test.Cardano.Ledger.Binary.Arbitrary (
1714 genShortByteString ,
1815) where
1916
20- import Cardano.Crypto.DSIGN.Class hiding (Signable )
21- import Cardano.Crypto.Util
22- import Cardano.Crypto.VRF.Class
2317import Cardano.Ledger.Binary.Version
2418import Codec.CBOR.ByteArray (ByteArray (.. ))
2519import Codec.CBOR.ByteArray.Sliced (SlicedByteArray (.. ))
@@ -148,36 +142,6 @@ instance
148142 arbitrary = VMap. fromMap <$> arbitrary
149143 shrink = fmap VMap. fromList . shrink . VMap. toList
150144
151- instance DSIGNAlgorithm v => Arbitrary (VerKeyDSIGN v ) where
152- arbitrary = deriveVerKeyDSIGN <$> arbitrary
153-
154- errorInvalidSize :: HasCallStack => Int -> Maybe a -> Gen a
155- errorInvalidSize n = maybe (error $ " Impossible: Invalid size " ++ show n) pure
156-
157- instance DSIGNAlgorithm v => Arbitrary (SignKeyDSIGN v ) where
158- arbitrary = do
159- let n = fromIntegral (signKeySizeDSIGN (Proxy @ v ))
160- bs <- genByteString n
161- errorInvalidSize n $ rawDeserialiseSignKeyDSIGN bs
162-
163- instance DSIGNAlgorithm v => Arbitrary (SigDSIGN v ) where
164- arbitrary = do
165- let n = fromIntegral (sigSizeDSIGN (Proxy @ v ))
166- bs <- genByteString n
167- errorInvalidSize n $ rawDeserialiseSigDSIGN bs
168-
169- instance DSIGNAlgorithm v => Arbitrary (SignedDSIGN v a ) where
170- arbitrary = SignedDSIGN <$> arbitrary
171-
172- instance
173- (ContextVRF v ~ () , Signable v ~ SignableRepresentation , VRFAlgorithm v ) =>
174- Arbitrary (CertifiedVRF v a )
175- where
176- arbitrary = CertifiedVRF <$> arbitrary <*> genCertVRF
177- where
178- genCertVRF :: Gen (CertVRF v )
179- genCertVRF = arbitrary
180-
181145instance Arbitrary Version where
182146 arbitrary = genVersion minBound maxBound
183147
0 commit comments