@@ -420,7 +420,7 @@ func TestProcessLoopRegularError(t *testing.T) {
420
420
assert .NoError (t , err , "Expected no error when setting up the mock partition consumer" )
421
421
422
422
mockSupport := & mockmultichain.ConsenterSupport {
423
- Batches : make (chan [] * cb.Envelope ), // WriteBlock will post here
423
+ Blocks : make (chan * cb.Block ), // WriteBlock will post here
424
424
BlockCutterVal : mockblockcutter .NewReceiver (),
425
425
ChainIDVal : mockChannel .topic (),
426
426
HeightVal : lastCutBlockNumber , // Incremented during the WriteBlock call
@@ -477,7 +477,7 @@ func TestProcessLoopRegularQueueEnvelope(t *testing.T) {
477
477
assert .NoError (t , err , "Expected no error when setting up the mock partition consumer" )
478
478
479
479
mockSupport := & mockmultichain.ConsenterSupport {
480
- Batches : make (chan [] * cb.Envelope ), // WriteBlock will post here
480
+ Blocks : make (chan * cb.Block ), // WriteBlock will post here
481
481
BlockCutterVal : mockblockcutter .NewReceiver (),
482
482
ChainIDVal : mockChannel .topic (),
483
483
HeightVal : lastCutBlockNumber , // Incremented during the WriteBlock call
@@ -530,7 +530,7 @@ func TestProcessLoopRegularCutBlock(t *testing.T) {
530
530
assert .NoError (t , err , "Expected no error when setting up the mock partition consumer" )
531
531
532
532
mockSupport := & mockmultichain.ConsenterSupport {
533
- Batches : make (chan [] * cb.Envelope ), // WriteBlock will post here
533
+ Blocks : make (chan * cb.Block ), // WriteBlock will post here
534
534
BlockCutterVal : mockblockcutter .NewReceiver (),
535
535
ChainIDVal : mockChannel .topic (),
536
536
HeightVal : lastCutBlockNumber , // Incremented during the WriteBlock call
@@ -546,7 +546,7 @@ func TestProcessLoopRegularCutBlock(t *testing.T) {
546
546
go func () { // Note: Unlike the CONNECT test case, the following does NOT introduce a race condition, so we're good
547
547
mockSupport .BlockCutterVal .Block <- struct {}{} // Let the `mockblockcutter.Ordered` call return
548
548
logger .Debugf ("Mock blockcutter's Ordered call has returned" )
549
- <- mockSupport .Batches // Let the `mockConsenterSupport.WriteBlock` proceed
549
+ <- mockSupport .Blocks // Let the `mockConsenterSupport.WriteBlock` proceed
550
550
logger .Debug ("Closing exitChan to exit the infinite for loop" ) // We are guaranteed to hit the exitChan branch after hitting the REGULAR branch at least once
551
551
close (exitChan ) // Identical to chain.Halt()
552
552
logger .Debug ("exitChan closed" )
@@ -590,7 +590,7 @@ func TestProcessLoopRegularCutTwoBlocks(t *testing.T) {
590
590
assert .NoError (t , err , "Expected no error when setting up the mock partition consumer" )
591
591
592
592
mockSupport := & mockmultichain.ConsenterSupport {
593
- Batches : make (chan [] * cb.Envelope ), // WriteBlock will post here
593
+ Blocks : make (chan * cb.Block ), // WriteBlock will post here
594
594
BlockCutterVal : mockblockcutter .NewReceiver (),
595
595
ChainIDVal : mockChannel .topic (),
596
596
HeightVal : lastCutBlockNumber , // Incremented during the WriteBlock call
@@ -614,15 +614,13 @@ func TestProcessLoopRegularCutTwoBlocks(t *testing.T) {
614
614
logger .Debugf ("Mock blockcutter's Ordered call has returned for the second time" )
615
615
616
616
select {
617
- case <- mockSupport .Batches : // Let the `mockConsenterSupport.WriteBlock` proceed
618
- block1 = mockSupport .WriteBlockVal
617
+ case block1 = <- mockSupport .Blocks : // Let the `mockConsenterSupport.WriteBlock` proceed
619
618
case <- time .After (hitBranch ):
620
619
logger .Fatalf ("Did not receive a block from the blockcutter as expected" )
621
620
}
622
621
623
622
select {
624
- case <- mockSupport .Batches :
625
- block2 = mockSupport .WriteBlockVal
623
+ case block2 = <- mockSupport .Blocks :
626
624
case <- time .After (hitBranch ):
627
625
logger .Fatalf ("Did not receive a block from the blockcutter as expected" )
628
626
}
@@ -677,7 +675,7 @@ func TestProcessLoopRegularAndSendTimeToCutRegular(t *testing.T) {
677
675
assert .NoError (t , err , "Expected no error when setting up the mock partition consumer" )
678
676
679
677
mockSupport := & mockmultichain.ConsenterSupport {
680
- Batches : make (chan [] * cb.Envelope ), // WriteBlock will post here
678
+ Blocks : make (chan * cb.Block ), // WriteBlock will post here
681
679
BlockCutterVal : mockblockcutter .NewReceiver (),
682
680
ChainIDVal : mockChannel .topic (),
683
681
HeightVal : lastCutBlockNumber , // Incremented during the WriteBlock call
@@ -746,7 +744,7 @@ func TestProcessLoopRegularAndSendTimeToCutError(t *testing.T) {
746
744
assert .NoError (t , err , "Expected no error when setting up the mock partition consumer" )
747
745
748
746
mockSupport := & mockmultichain.ConsenterSupport {
749
- Batches : make (chan [] * cb.Envelope ), // WriteBlock will post here
747
+ Blocks : make (chan * cb.Block ), // WriteBlock will post here
750
748
BlockCutterVal : mockblockcutter .NewReceiver (),
751
749
ChainIDVal : mockChannel .topic (),
752
750
HeightVal : lastCutBlockNumber , // Incremented during the WriteBlock call
@@ -801,7 +799,7 @@ func TestProcessLoopTimeToCutFromReceivedMessageRegular(t *testing.T) {
801
799
assert .NoError (t , err , "Expected no error when setting up the mock partition consumer" )
802
800
803
801
mockSupport := & mockmultichain.ConsenterSupport {
804
- Batches : make (chan [] * cb.Envelope ), // WriteBlock will post here
802
+ Blocks : make (chan * cb.Block ), // WriteBlock will post here
805
803
BlockCutterVal : mockblockcutter .NewReceiver (),
806
804
ChainIDVal : mockChannel .topic (),
807
805
HeightVal : lastCutBlockNumber , // Incremented during the WriteBlock call
@@ -818,7 +816,7 @@ func TestProcessLoopTimeToCutFromReceivedMessageRegular(t *testing.T) {
818
816
mockSupport .BlockCutterVal .Ordered (newMockEnvelope ("fooMessage" ))
819
817
820
818
go func () { // Note: Unlike the CONNECT test case, the following does NOT introduce a race condition, so we're good
821
- <- mockSupport .Batches // Let the `mockConsenterSupport.WriteBlock` proceed
819
+ <- mockSupport .Blocks // Let the `mockConsenterSupport.WriteBlock` proceed
822
820
logger .Debug ("Closing exitChan to exit the infinite for loop" ) // We are guaranteed to hit the exitChan branch after hitting the REGULAR branch at least once
823
821
close (exitChan ) // Identical to chain.Halt()
824
822
logger .Debug ("exitChan closed" )
@@ -858,7 +856,7 @@ func TestProcessLoopTimeToCutFromReceivedMessageZeroBatch(t *testing.T) {
858
856
assert .NoError (t , err , "Expected no error when setting up the mock partition consumer" )
859
857
860
858
mockSupport := & mockmultichain.ConsenterSupport {
861
- Batches : make (chan [] * cb.Envelope ), // WriteBlock will post here
859
+ Blocks : make (chan * cb.Block ), // WriteBlock will post here
862
860
BlockCutterVal : mockblockcutter .NewReceiver (),
863
861
ChainIDVal : mockChannel .topic (),
864
862
HeightVal : lastCutBlockNumber , // Incremented during the WriteBlock call
@@ -902,7 +900,7 @@ func TestProcessLoopTimeToCutFromReceivedMessageLargerThanExpected(t *testing.T)
902
900
assert .NoError (t , err , "Expected no error when setting up the mock partition consumer" )
903
901
904
902
mockSupport := & mockmultichain.ConsenterSupport {
905
- Batches : make (chan [] * cb.Envelope ), // WriteBlock will post here
903
+ Blocks : make (chan * cb.Block ), // WriteBlock will post here
906
904
BlockCutterVal : mockblockcutter .NewReceiver (),
907
905
ChainIDVal : mockChannel .topic (),
908
906
HeightVal : lastCutBlockNumber , // Incremented during the WriteBlock call
@@ -948,7 +946,7 @@ func TestProcessLoopTimeToCutFromReceivedMessageStale(t *testing.T) {
948
946
assert .NoError (t , err , "Expected no error when setting up the mock partition consumer" )
949
947
950
948
mockSupport := & mockmultichain.ConsenterSupport {
951
- Batches : make (chan [] * cb.Envelope ), // WriteBlock will post here
949
+ Blocks : make (chan * cb.Block ), // WriteBlock will post here
952
950
BlockCutterVal : mockblockcutter .NewReceiver (),
953
951
ChainIDVal : mockChannel .topic (),
954
952
HeightVal : lastCutBlockNumber , // Incremented during the WriteBlock call
0 commit comments