@@ -998,86 +998,6 @@ func TestEpochQCSignedByNonExistentNodes(t *testing.T) {
998998 })
999999}
10001000
1001- // func TestEpochDiscardEmptyVotesWithParent(t *testing.T) {
1002- // loggedMessages := make(chan string, 100)
1003- // l := testutil.MakeLogger(t, 1)
1004- // l.Intercept(func(entry zapcore.Entry) error {
1005- // loggedMessages <- entry.Message
1006- // return nil
1007- // })
1008- // hasLogged := func(msg string) bool {
1009- // for len(loggedMessages) > 0 {
1010- // loggedMsg := <-loggedMessages
1011- // if loggedMsg == msg {
1012- // return true
1013- // }
1014- // }
1015- // return false
1016- // }
1017-
1018- // bb := &testBlockBuilder{out: make(chan *testBlock, 1)}
1019- // storage := newInMemStorage()
1020-
1021- // nodes := []NodeID{{1}, {2}, {3}, {4}}
1022- // conf := EpochConfig{
1023- // MaxProposalWait: DefaultMaxProposalWaitTime,
1024- // Logger: l,
1025- // ID: nodes[0],
1026- // Signer: &testSigner{},
1027- // WAL: newTestWAL(t),
1028- // Verifier: &testVerifier{},
1029- // Storage: storage,
1030- // Comm: noopComm(nodes),
1031- // BlockBuilder: bb,
1032- // SignatureAggregator: &testSignatureAggregator{},
1033- // }
1034-
1035- // e, err := NewEpoch(conf)
1036- // require.NoError(t, err)
1037-
1038- // require.NoError(t, e.Start())
1039-
1040- // vb, _ := notarizeAndFinalizeRound(t, e, bb)
1041- // require.NotNil(t, vb)
1042-
1043- // emptyBlockMd := e.Metadata()
1044- // emptyBlockMd.Seq--
1045-
1046- // // Receive empty votes from all nodes, but with a parent set to the last block.
1047- // // While this is not a real scenario but an artificial one, we are testing it to ensure that we do not
1048- // // collect an empty notarization.
1049- // for i := 1; i <= 3; i++ {
1050- // emptyVote := createEmptyVote(emptyBlockMd, nodes[i])
1051- // emptyVote.Vote.Prev = vb.BlockHeader().Digest
1052-
1053- // require.False(t, hasLogged("Empty vote has a parent but should not have one"))
1054-
1055- // e.HandleMessage(&Message{
1056- // EmptyVoteMessage: emptyVote,
1057- // }, nodes[i])
1058-
1059- // require.True(t, hasLogged("Empty vote has a parent but should not have one"))
1060- // }
1061-
1062- // emptyNotarization := newEmptyNotarization(nodes, emptyBlockMd.Round, emptyBlockMd.Seq)
1063- // emptyNotarization.Vote.Prev = vb.BlockHeader().Digest
1064-
1065- // require.False(t, hasLogged("Empty notarization vote has a parent but should not have one"))
1066-
1067- // e.HandleMessage(&Message{
1068- // EmptyNotarization: emptyNotarization,
1069- // }, nodes[1])
1070-
1071- // require.True(t, hasLogged("Empty notarization vote has a parent but should not have one"))
1072-
1073- // vb, _ = notarizeAndFinalizeRound(t, e, bb)
1074- // require.NotNil(t, vb)
1075-
1076- // // Ensure the previous empty votes and empty notarization did not have any effect.
1077- // require.Equal(t, uint64(1), vb.BlockHeader().Round)
1078-
1079- // }
1080-
10811001func TestEpochBlockSentFromNonLeader (t * testing.T ) {
10821002 l := testutil .MakeLogger (t , 1 )
10831003 nonLeaderMessage := false
0 commit comments