Skip to content

Commit

Permalink
use port 0
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt committed Jul 12, 2023
1 parent 64b1bae commit e8141cc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions p2p/transport/webtransport/transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,15 @@ 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/12233/quic-v1/webtransport/"),
ma.StringCast("/ip4/127.0.0.1/udp/0/quic-v1/webtransport/"),
// the random certhash will be ignored and correct certhash will be used
ma.StringCast("/ip4/127.0.0.1/udp/0/quic-v1/webtransport/certhash/" + randomMultihash(t)),
}

invalid := []ma.Multiaddr{
ma.StringCast("/ip4/127.0.0.1/udp/12233"), // missing webtransport
ma.StringCast("/ip4/127.0.0.1/udp/12233/webtransport"), // missing quic
ma.StringCast("/ip4/127.0.0.1/tcp/12233/webtransport"), // WebTransport over TCP? Is this a joke?
ma.StringCast("/ip4/127.0.0.1/udp/12233/quic-v1/webtransport/certhash/" + randomMultihash(t)),
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?
}

_, key := newIdentity(t)
Expand Down

0 comments on commit e8141cc

Please sign in to comment.