code: func (s *MockDeliverServer) Deliver(srv pb.Deliver_DeliverServer) error {
  	status := s.Status()
  	if status != cb.Status_UNKNOWN {
  		err := srv.Send(&pb.DeliverResponse{
  			Type: &pb.DeliverResponse_Status{
  				Status: status,
  			},
  		})
  		return errors.Errorf("returning error status: %s %s", status, err)
  	}
  	disconnect := make(chan bool)
  
  	go s.handleEvents(srv, disconnect)
  
  	for {
  		envelope, err := srv.Recv()
  		if err == io.EOF || envelope == nil {
  			break
  		}
  
  		err = s.disconnectErr()
  		if err != nil {
  			return err
  		}
  
  		newBlock := mocks.NewSimpleMockBlock()
  		err1 := srv.Send(&pb.DeliverResponse{
  			Type: &pb.DeliverResponse_Block{
  				Block: newBlock,
  			},
  		})
  		if err1 != nil {
  			return err1
  		}
  		if err == io.EOF {
  			test.Logf("*** mockdelserver err is io.EOF or envelope == nil, disconnecting from Deliver..")
  			disconnect <- true
  			break
  		}
  	}
  	return nil
  }
docs: // Deliver delivers a stream of blocks