()
| 44 | } |
| 45 | |
| 46 | func 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 | } |
| 78 | func TestIsPeerAlive(t *testing.T) { |
| 79 | server := constructServer() |
| 80 | server.peerPool = peerPool() |
no outgoing calls
no test coverage detected