Skip to content

Commit

Permalink
Rename helper function to firstCertificateIsNotRetirement.
Browse files Browse the repository at this point in the history
This more accurately reflects the function's purpose.

We don't actually mind if the list of certificates is empty.
  • Loading branch information
jonathanknowles committed Sep 7, 2020
1 parent 5f346bd commit 62606ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/core/test/unit/Cardano/Pool/DB/Arbitrary.hs
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,14 @@ isValidSinglePoolCertificateSequence :: SinglePoolCertificateSequence -> Bool
isValidSinglePoolCertificateSequence
(SinglePoolCertificateSequence sharedPoolId certificates) =
allCertificatesReferToSamePool &&
firstCertificateIsRegistration
firstCertificateIsNotRetirement
where
allCertificatesReferToSamePool =
all (== sharedPoolId) (getPoolCertificatePoolId <$> certificates)
firstCertificateIsRegistration = case certificates of
firstCertificateIsNotRetirement = case certificates of
[] -> True
Registration _ : _ -> True
Retirement _ : _ -> False
[] -> True
Retirement _ : _ -> False

instance Arbitrary SinglePoolCertificateSequence where

Expand Down

0 comments on commit 62606ff

Please sign in to comment.