Skip to content

Commit

Permalink
Use port 0
Browse files Browse the repository at this point in the history
Co-authored-by: marcopolo <[email protected]>
Co-authored-by: sukunrt <[email protected]>
  • Loading branch information
MarcoPolo and sukunrt committed Jul 13, 2023
1 parent 84edfb7 commit 6542b00
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions p2p/transport/webtransport/transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,14 @@ func TestCanDial(t *testing.T) {
func TestListenAddrValidity(t *testing.T) {
valid := []ma.Multiaddr{
ma.StringCast("/ip6/::/udp/0/quic-v1/webtransport/"),
ma.StringCast("/ip4/127.0.0.1/udp/1234/quic-v1/webtransport/"),
ma.StringCast("/ip4/127.0.0.1/udp/0/quic-v1/webtransport/"),
}

invalid := []ma.Multiaddr{
ma.StringCast("/ip4/127.0.0.1/udp/1234"), // missing webtransport
ma.StringCast("/ip4/127.0.0.1/udp/1234/webtransport"), // missing quic
ma.StringCast("/ip4/127.0.0.1/tcp/1234/webtransport"), // WebTransport over TCP? Is this a joke?
ma.StringCast("/ip4/127.0.0.1/udp/1234/quic-v1/webtransport/certhash/" + randomMultihash(t)), // We can't listen on a specific certhash
ma.StringCast("/ip4/127.0.0.1/udp/11234/quic-v1/webtransport/certhash/" + randomMultihash(t)), // We can't listen on a specific certhash
ma.StringCast("/ip4/127.0.0.1/udp/0"), // missing webtransport
ma.StringCast("/ip4/127.0.0.1/udp/0/webtransport"), // missing quic
ma.StringCast("/ip4/127.0.0.1/tcp/0/webtransport"), // WebTransport over TCP? Is this a joke?
ma.StringCast("/ip4/127.0.0.1/udp/0/quic-v1/webtransport/certhash/" + randomMultihash(t)), // We can't listen on a specific certhash
}

_, key := newIdentity(t)
Expand Down

0 comments on commit 6542b00

Please sign in to comment.