1 {-# OPTIONS -fno-warn-orphans #-}
2 module QuickCheck.Trustee where
4 import Test.Tasty.QuickCheck
9 import QuickCheck.Election ()
11 quickcheck :: TestTree
14 [ testGroup "verifyIndispensableTrusteePublicKey" $
15 [ testIndispensableTrusteePublicKey @WeakParams
16 , testIndispensableTrusteePublicKey @BeleniosParams
20 testIndispensableTrusteePublicKey :: forall q. Params q => TestTree
21 testIndispensableTrusteePublicKey =
22 testGroup (paramsName @q)
23 [ testProperty "Right" $ \seed ->
25 (`evalStateT` mkStdGen seed) $ do
26 trusteeSecKey :: SecretKey q <- randomSecretKey
27 trusteePubKey <- proveIndispensableTrusteePublicKey trusteeSecKey
28 lift $ verifyIndispensableTrusteePublicKey trusteePubKey
31 instance SubGroup q => Arbitrary (TrusteePublicKey q) where
33 trustee_PublicKey <- arbitrary
34 trustee_SecretKeyProof <- arbitrary
35 return TrusteePublicKey{..}