Skip to content

Commit

Permalink
Extend prop_rollbackRetirement.
Browse files Browse the repository at this point in the history
Extend `prop_rollbackRetirement` to call `listRetiredPools`.
  • Loading branch information
jonathanknowles committed Aug 13, 2020
1 parent 7f4745f commit e539aa2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/core/test/unit/Cardano/Pool/DB/Properties.hs
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,8 @@ prop_rollbackRetirement DBLayer{..} certificates =
run $ atomically $ rollbackTo rollbackPoint
retrievedPublications <- catMaybes <$>
run (atomically $ mapM readPoolRetirement poolIds)
poolsMarkedToRetire <-
run $ atomically $ listRetiredPools $ EpochNo maxBound
monitor $ counterexample $ unlines
[ "\nRollback point: "
, show rollbackPoint
Expand All @@ -785,11 +787,17 @@ prop_rollbackRetirement DBLayer{..} certificates =
, unlines (("\n" <>) . show <$> expectedPublications)
, "\nRetrieved certificate publications: "
, unlines (("\n" <>) . show <$> retrievedPublications)
, "All pools that are marked to retire: "
, unlines (("\n" <>) . show <$> poolsMarkedToRetire)
]
assertWith "retrieved publications match expectations" $
(==)
retrievedPublications
expectedPublications
assertWith "only the correct retirements are listed" $
(==)
(Set.fromList $ snd <$> expectedPublications)
(Set.fromList poolsMarkedToRetire)

poolIds :: [PoolId]
poolIds = view #poolId <$> certificates
Expand Down

0 comments on commit e539aa2

Please sign in to comment.