@@ -39,6 +39,7 @@ func TestConstructFails(t *testing.T) {
3939 "/udp/65536" ,
4040 "/tcp/65536" ,
4141 "/quic/65536" ,
42+ "/quic-v1/65536" ,
4243 "/onion/9imaq4ygg2iegci7:80" ,
4344 "/onion/aaimaq4ygg2iegci7:80" ,
4445 "/onion/timaq4ygg2iegci7:0" ,
@@ -74,8 +75,9 @@ func TestConstructFails(t *testing.T) {
7475 "/ip4/127.0.0.1/tcp/jfodsajfidosajfoidsa" ,
7576 "/ip4/127.0.0.1/tcp" ,
7677 "/ip4/127.0.0.1/quic/1234" ,
77- "/ip4/127.0.0.1/udp/1234/quic/webtransport/certhash" ,
78- "/ip4/127.0.0.1/udp/1234/quic/webtransport/certhash/b2uaraocy6yrdblb4sfptaddgimjmmp" , // 1 character missing from certhash
78+ "/ip4/127.0.0.1/quic-v1/1234" ,
79+ "/ip4/127.0.0.1/udp/1234/quic-v1/webtransport/certhash" ,
80+ "/ip4/127.0.0.1/udp/1234/quic-v1/webtransport/certhash/b2uaraocy6yrdblb4sfptaddgimjmmp" , // 1 character missing from certhash
7981 "/ip4/127.0.0.1/ipfs" ,
8082 "/ip4/127.0.0.1/ipfs/tcp" ,
8183 "/ip4/127.0.0.1/p2p" ,
@@ -109,11 +111,13 @@ func TestConstructSucceeds(t *testing.T) {
109111 "/ip6/::1" ,
110112 "/ip6/2601:9:4f81:9700:803e:ca65:66e8:c21" ,
111113 "/ip6/2601:9:4f81:9700:803e:ca65:66e8:c21/udp/1234/quic" ,
114+ "/ip6/2601:9:4f81:9700:803e:ca65:66e8:c21/udp/1234/quic-v1" ,
112115 "/ip6/2001:db8::/ipcidr/32" ,
113116 "/ip6zone/x/ip6/fe80::1" ,
114117 "/ip6zone/x%y/ip6/fe80::1" ,
115118 "/ip6zone/x%y/ip6/::" ,
116119 "/ip6zone/x/ip6/fe80::1/udp/1234/quic" ,
120+ "/ip6zone/x/ip6/fe80::1/udp/1234/quic-v1" ,
117121 "/onion/timaq4ygg2iegci7:1234" ,
118122 "/onion/timaq4ygg2iegci7:80/http" ,
119123 "/onion3/vww6ybal4bd7szmgncyruucpgfkqahzddi37ktceo3ah7ngmcopnpyyd:1234" ,
@@ -159,9 +163,10 @@ func TestConstructSucceeds(t *testing.T) {
159163 "/ip4/127.0.0.1/tcp/1234" ,
160164 "/ip4/127.0.0.1/tcp/1234/" ,
161165 "/ip4/127.0.0.1/udp/1234/quic" ,
162- "/ip4/127.0.0.1/udp/1234/quic/webtransport" ,
163- "/ip4/127.0.0.1/udp/1234/quic/webtransport/certhash/b2uaraocy6yrdblb4sfptaddgimjmmpy" ,
164- "/ip4/127.0.0.1/udp/1234/quic/webtransport/certhash/b2uaraocy6yrdblb4sfptaddgimjmmpy/certhash/zQmbWTwYGcmdyK9CYfNBcfs9nhZs17a6FQ4Y8oea278xx41" ,
166+ "/ip4/127.0.0.1/udp/1234/quic-v1" ,
167+ "/ip4/127.0.0.1/udp/1234/quic-v1/webtransport" ,
168+ "/ip4/127.0.0.1/udp/1234/quic-v1/webtransport/certhash/b2uaraocy6yrdblb4sfptaddgimjmmpy" ,
169+ "/ip4/127.0.0.1/udp/1234/quic-v1/webtransport/certhash/b2uaraocy6yrdblb4sfptaddgimjmmpy/certhash/zQmbWTwYGcmdyK9CYfNBcfs9nhZs17a6FQ4Y8oea278xx41" ,
165170 "/ip4/127.0.0.1/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC" ,
166171 "/ip4/127.0.0.1/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC/tcp/1234" ,
167172 "/ip4/127.0.0.1/ipfs/k2k4r8oqamigqdo6o7hsbfwd45y70oyynp98usk7zmyfrzpqxh1pohl7" ,
@@ -566,7 +571,7 @@ func TestRoundTrip(t *testing.T) {
566571 "/ip4/127.0.0.1/tcp/123/tls" ,
567572 "/ip4/127.0.0.1/udp/123" ,
568573 "/ip4/127.0.0.1/udp/123/ip6/::" ,
569- "/ip4/127.0.0.1/udp/1234/quic/webtransport/certhash/uEiDDq4_xNyDorZBH3TlGazyJdOWSwvo4PUo5YHFMrvDE8g" ,
574+ "/ip4/127.0.0.1/udp/1234/quic-v1 /webtransport/certhash/uEiDDq4_xNyDorZBH3TlGazyJdOWSwvo4PUo5YHFMrvDE8g" ,
570575 "/p2p/QmbHVEEepCi7rn7VL7Exxpd2Ci9NNB6ifvqwhsrbRMgQFP" ,
571576 "/p2p/QmbHVEEepCi7rn7VL7Exxpd2Ci9NNB6ifvqwhsrbRMgQFP/unix/a/b/c" ,
572577 } {
@@ -796,11 +801,13 @@ func TestContains(t *testing.T) {
796801 a1 := newMultiaddr (t , "/ip4/127.0.0.1/tcp/1234" )
797802 a2 := newMultiaddr (t , "/ip4/1.1.1.1/tcp/999" )
798803 a3 := newMultiaddr (t , "/ip4/1.2.3.4/udp/443/quic" )
799- addrs := []Multiaddr {a1 , a2 , a3 }
804+ a4 := newMultiaddr (t , "/ip4/1.2.3.4/udp/443/quic-v1" )
805+ addrs := []Multiaddr {a1 , a2 , a3 , a4 }
800806
801807 require .True (t , Contains (addrs , a1 ))
802808 require .True (t , Contains (addrs , a2 ))
803809 require .True (t , Contains (addrs , a3 ))
810+ require .True (t , Contains (addrs , a4 ))
804811 require .False (t , Contains (addrs , newMultiaddr (t , "/ip4/4.3.2.1/udp/1234/utp" )))
805812 require .False (t , Contains (nil , a1 ))
806813}
0 commit comments