MCPcopy Create free account
hub / github.com/DNAProject/DNA / constructPeerPool

Function constructPeerPool

consensus/vbft/peer_pool_test.go:32–47  ·  view source on GitHub ↗
(connect bool)

Source from the content-addressed store, hash-verified

30)
31
32func constructPeerPool(connect bool) *PeerPool {
33 peer := &Peer{
34 Index: uint32(1),
35 LastUpdateTime: time.Unix(0, 0),
36 connected: connect,
37 }
38 peers := make(map[uint32]*Peer)
39 peers[1] = peer
40 peerpool := &PeerPool{
41 maxSize: int(3),
42 configs: make(map[uint32]*vconfig.PeerConfig),
43 IDMap: make(map[string]uint32),
44 peers: peers,
45 }
46 return peerpool
47}
48func TestIsNewPeer(t *testing.T) {
49 peerpool := constructPeerPool(false)
50 isnew := peerpool.isNewPeer(uint32(2))

Callers 9

peerPoolFunction · 0.85
TestIsNewPeerFunction · 0.85
TestAddPeerFunction · 0.85
TestGetActivePeerCountFunction · 0.85
TestPeerHandshakeFunction · 0.85
TestPeerHeartbeatFunction · 0.85
TestGetNeighboursFunction · 0.85
TestGetPeerIndexFunction · 0.85
TestGetPeerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected