Skip to content

Commit

Permalink
[network, test-only] document tagsObserver in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker committed Aug 19, 2021
1 parent c712689 commit 18cf175
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions network/test/middleware_test.go
Expand Up @@ -28,6 +28,11 @@ import (

const testChannel = "test-channel"

// libp2p emits a call to `Protect` with a topic-specific tag upon establishing each peering connection in a GossipSUb mesh, see:
// https://github.com/libp2p/go-libp2p-pubsub/blob/master/tag_tracer.go
// One way to make sure such a mesh has formed, asynchronously, in unit tests, is to wait for libp2p.GossipSubD such calls,
// and that's what we do with tagsObserver.
//
type tagsObserver struct {
tags chan string
log zerolog.Logger
Expand Down

0 comments on commit 18cf175

Please sign in to comment.