File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -237,15 +237,15 @@ prop_leashingAttackStalling =
237
237
advs <- mapM dropRandomPoints $ adversarialPeers sch
238
238
pure $ ps {psSchedule = sch {adversarialPeers = advs}}
239
239
240
- dropRandomPoints :: [(Time , SchedulePoint blk )] -> QC. Gen [(Time , SchedulePoint blk )]
241
- dropRandomPoints ps = do
240
+ dropRandomPoints :: [(Time , SchedulePoint blk )] -> QC. Gen [(Time , SchedulePoint blk )]
241
+ dropRandomPoints ps = do
242
242
let lenps = length ps
243
243
dropsMax = max 1 $ lenps - 1
244
244
dropCount <- QC. choose (div dropsMax 2 , dropsMax)
245
245
let dedup = map NE. head . NE. group
246
246
is <- fmap (dedup . sort) $ replicateM dropCount $ QC. choose (0 , lenps - 1 )
247
247
pure $ dropElemsAt ps is
248
-
248
+ where
249
249
dropElemsAt :: [a ] -> [Int ] -> [a ]
250
250
dropElemsAt xs is' =
251
251
let is = Set. fromList is'
@@ -286,7 +286,8 @@ prop_leashingAttackTimeLimited =
286
286
(gtLoPBucketParams genesisTest)
287
287
(getHonestPeer honests)
288
288
(Map. elems advs0)
289
- advs = fmap (takePointsUntil timeLimit) advs0
289
+ advs1 = fmap (takePointsUntil timeLimit) advs0
290
+ advs <- mapM dropRandomPoints advs1
290
291
pure $ PointSchedule
291
292
{ psSchedule = Peers honests advs
292
293
, psStartOrder = []
You can’t perform that action at this time.
0 commit comments