@@ -558,15 +558,6 @@ func testReplicationAfterNodeDisconnects(t *testing.T, nodes []simplex.NodeID, s
558558 }
559559}
560560
561- func onlyAllowBlockProposalsAndNotarizations (msg * simplex.Message , _ , to simplex.NodeID ) bool {
562- // TODO: remove hardcoded node id
563- if to .Equals (simplex.NodeID {4 }) {
564- return (msg .BlockMessage != nil || msg .VerifiedBlockMessage != nil || msg .Notarization != nil )
565- }
566-
567- return true
568- }
569-
570561// sendVotesToOneNode allows block messages to be sent to all nodes, and only
571562// passes vote messages to one node. This will allows that node to notarize the block,
572563// while the other blocks will timeout
@@ -849,6 +840,14 @@ func TestReplicationNotarizationWithoutFinalizations(t *testing.T) {
849840func testReplicationNotarizationWithoutFinalizations (t * testing.T , numBlocks uint64 , nodes []simplex.NodeID ) {
850841 net := NewInMemNetwork (t , nodes )
851842
843+ onlyAllowBlockProposalsAndNotarizations := func (msg * simplex.Message , _ , to simplex.NodeID ) bool {
844+ if to .Equals (nodes [3 ]) {
845+ return (msg .BlockMessage != nil || msg .VerifiedBlockMessage != nil || msg .Notarization != nil )
846+ }
847+
848+ return true
849+ }
850+
852851 nodeConfig := func (from simplex.NodeID ) * TestNodeConfig {
853852 comm := NewTestComm (from , net , onlyAllowBlockProposalsAndNotarizations )
854853 return & TestNodeConfig {
@@ -875,7 +874,6 @@ func testReplicationNotarizationWithoutFinalizations(t *testing.T, numBlocks uin
875874 for _ , n := range net .Instances [:3 ] {
876875 n .Storage .WaitForBlockCommit (uint64 (i ))
877876 }
878-
879877 }
880878
881879 laggingNode .WAL .AssertNotarization (numBlocks - 1 )
0 commit comments