Skip to content

Commit

Permalink
Tweak DiffusionScript generator
Browse files Browse the repository at this point in the history
  • Loading branch information
bolt12 committed May 9, 2022
1 parent 8c55d72 commit ab7c78b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,20 @@ genIP ips =
genCommands :: [(Int, Map RelayAccessPoint PeerAdvertise)] -> Gen [Command]
genCommands localRoots = sized $ \size -> do
port <- fromIntegral <$> (arbitrary :: Gen Int)
commands <- vectorOf size (frequency [ (7, JoinNetwork
commands <- vectorOf size (frequency [ (10, JoinNetwork
<$> delay
<*> ( Just
. TestAddress
. flip IPAddr port
<$> genIP []
))
, (7, JoinNetwork
, (10, JoinNetwork
<$> delay
<*> pure Nothing)
, (4, Reconfigure
, (6, Reconfigure
<$> delay
<*> subLocalRootPeers)
, (1, Kill <$> delay)
, (3, Kill <$> delay)
])
return (fixupCommands commands)
where
Expand Down Expand Up @@ -202,7 +202,7 @@ instance Arbitrary DiffusionScript where
arbitrary = do
-- Limit the number of nodes to run in Simulation otherwise it is going
-- to take very long time for tests to run
size <- chooseInt (0, 3)
size <- chooseInt (0, 5)
raps <- nub <$> vectorOf size arbitrary

let toRunRaps = [ r | r@(RelayAccessAddress _ _) <- raps ]
Expand Down

0 comments on commit ab7c78b

Please sign in to comment.