{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE TemplateHaskell #-}
module Test.Cardano.Crypto.Signing.Safe (
tests,
)
where
import Cardano.Crypto.Signing (
noPassSafeSigner,
safeToVerification,
toVerification,
)
import Cardano.Prelude
import Hedgehog (
Property,
checkParallel,
discover,
forAll,
property,
(===),
)
import Test.Cardano.Crypto.Gen (genSigningKey)
tests :: IO Bool
tests :: IO Bool
tests = forall (m :: * -> *). MonadIO m => Group -> m Bool
checkParallel $$String
[(PropertyName, Property)]
Property
String -> PropertyName
String -> GroupName
GroupName -> [(PropertyName, Property)] -> Group
discover
prop_safeSignerPreservesVerificationKey :: Property
prop_safeSignerPreservesVerificationKey :: Property
prop_safeSignerPreservesVerificationKey = HasCallStack => PropertyT IO () -> Property
property forall a b. (a -> b) -> a -> b
$ do
SigningKey
sk <- forall (m :: * -> *) a.
(Monad m, Show a, HasCallStack) =>
Gen a -> PropertyT m a
forAll Gen SigningKey
genSigningKey
SafeSigner -> VerificationKey
safeToVerification (SigningKey -> SafeSigner
noPassSafeSigner SigningKey
sk) forall (m :: * -> *) a.
(MonadTest m, Eq a, Show a, HasCallStack) =>
a -> a -> m ()
=== SigningKey -> VerificationKey
toVerification SigningKey
sk