Commit 9cf4267a authored by Iustin Pop's avatar Iustin Pop
Browse files

Finish removal of unused params from PeerMap

This completes the removal started earlier byt removeing the need to
pass the number of nodes to Node.buildPeers, which is now unused.
parent 15f4c8ca
......@@ -96,7 +96,7 @@ mergeData (nl, il) = do
nl2 = fixNodes nl il
il3 = Container.fromAssocList il
nl3 = Container.fromAssocList
(map (\ (k, v) -> (k, Node.buildPeers v il3 (length nl2))) nl2)
(map (\ (k, v) -> (k, Node.buildPeers v il3)) nl2)
node_names = map Node.name $ Container.elems nl3
inst_names = map Instance.name $ Container.elems il3
common_suffix = longestDomain (node_names ++ inst_names)
......
......@@ -148,8 +148,8 @@ computeMaxRes :: PeerMap.PeerMap -> PeerMap.Elem
computeMaxRes new_peers = PeerMap.maxElem new_peers
-- | Builds the peer map for a given node.
buildPeers :: Node -> Instance.List -> Int -> Node
buildPeers t il num_nodes =
buildPeers :: Node -> Instance.List -> Node
buildPeers t il =
let mdata = map
(\i_idx -> let inst = Container.find i_idx il
in (Instance.pnode inst, Instance.mem inst))
......
......@@ -41,10 +41,9 @@ instance Arbitrary Node.Node where
dsk_t <- arbitrary
dsk_f <- choose (0, dsk_t)
offl <- arbitrary
npeers <- choose (0, 100)
let n = Node.create name (fromIntegral mem_t) mem_n mem_f
(fromIntegral dsk_t) dsk_f offl
n' = Node.buildPeers n Container.empty npeers
n' = Node.buildPeers n Container.empty
return n'
-- | Make sure add is idempotent
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment