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

Function constructServer

consensus/vbft/node_utils_test.go:46–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44}
45
46func constructServer() *Server {
47 statemgr := &StateMgr{
48 currentState: Syncing,
49 }
50 blockparticipantconfig := &BlockParticipantConfig{
51 BlockNum: 1,
52 Proposers: []uint32{1, 2, 3},
53 Endorsers: []uint32{1, 2, 3},
54 Committers: []uint32{1, 2, 3},
55 }
56 chainconfig := &vconfig.ChainConfig{
57 Version: 1,
58 View: 12,
59 N: 4,
60 C: 1,
61 BlockMsgDelay: 1000,
62 HashMsgDelay: 1000,
63 PeerHandshakeTimeout: 10000,
64 PosTable: []uint32{2, 3, 1, 3, 1, 3, 2, 3, 2, 3, 2, 1, 3, 0},
65 }
66 chainstore := &ChainStore{
67 chainedBlockNum: 2,
68 }
69 server := &Server{
70 Index: 1,
71 stateMgr: statemgr,
72 config: chainconfig,
73 chainStore: chainstore,
74 currentParticipantConfig: blockparticipantconfig,
75 }
76 return server
77}
78func TestIsPeerAlive(t *testing.T) {
79 server := constructServer()
80 server.peerPool = peerPool()

Callers 15

TestStateMgr_getStateFunction · 0.85
constructPeerStateFunction · 0.85
TestAddMsgFunction · 0.85
TestHasMsgFunction · 0.85
TestGetProposalMsgsFunction · 0.85
TestGetEndorsementsMsgsFunction · 0.85
TestGetCommitMsgsFunction · 0.85
TestOnBlockSealedFunction · 0.85
TestIsPeerAliveFunction · 0.85
TestIsPeerActiveFunction · 0.85
TestIsProposerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected