Skip to content

Commit

Permalink
Add property prop_determinePoolRegistrationStatus_differentPools.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Jul 6, 2020
1 parent 1596572 commit f755bda
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/core/test/unit/Cardano/Pool/DB/Properties.hs
Expand Up @@ -173,6 +173,9 @@ properties = do
it "prop_determinePoolRegistrationStatus_neverRegistered" $
(property . const
prop_determinePoolRegistrationStatus_neverRegistered)
it "prop_determinePoolRegistrationStatus_differentPools" $
(property . const
prop_determinePoolRegistrationStatus_differentPools)

{-------------------------------------------------------------------------------
Properties
Expand Down Expand Up @@ -623,6 +626,26 @@ prop_determinePoolRegistrationStatus_neverRegistered maybeRetData =
where
result = determinePoolRegistrationStatus Nothing maybeRetData

prop_determinePoolRegistrationStatus_differentPools
:: forall certificatePublicationTime . (certificatePublicationTime ~ Int)
=> (certificatePublicationTime, PoolRegistrationCertificate)
-> (certificatePublicationTime, PoolRetirementCertificate)
-> Property
prop_determinePoolRegistrationStatus_differentPools regData retData =
property $ (regPoolId /= retPoolId) ==> prop
where
prop = evaluate result `shouldThrow` anyException

regPoolId = view #poolId regCert
retPoolId = view #poolId retCert

(regTime, regCert) = regData
(retTime, retCert) = retData

result = determinePoolRegistrationStatus
(pure (regTime, regCert))
(pure (retTime, retCert))

descSlotsPerPool :: Map PoolId [BlockHeader] -> Expectation
descSlotsPerPool pools = do
let checkIfDesc slots =
Expand Down

0 comments on commit f755bda

Please sign in to comment.