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 =
237237 advs <- mapM dropRandomPoints $ adversarialPeers sch
238238 pure $ ps {psSchedule = sch {adversarialPeers = advs}}
239239
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
242242 let lenps = length ps
243243 dropsMax = max 1 $ lenps - 1
244244 dropCount <- QC. choose (div dropsMax 2 , dropsMax)
245245 let dedup = map NE. head . NE. group
246246 is <- fmap (dedup . sort) $ replicateM dropCount $ QC. choose (0 , lenps - 1 )
247247 pure $ dropElemsAt ps is
248-
248+ where
249249 dropElemsAt :: [a ] -> [Int ] -> [a ]
250250 dropElemsAt xs is' =
251251 let is = Set. fromList is'
@@ -286,7 +286,8 @@ prop_leashingAttackTimeLimited =
286286 (gtLoPBucketParams genesisTest)
287287 (getHonestPeer honests)
288288 (Map. elems advs0)
289- advs = fmap (takePointsUntil timeLimit) advs0
289+ advs1 = fmap (takePointsUntil timeLimit) advs0
290+ advs <- mapM dropRandomPoints advs1
290291 pure $ PointSchedule
291292 { psSchedule = Peers honests advs
292293 , psStartOrder = []
You can’t perform that action at this time.
0 commit comments