@@ -85,7 +85,9 @@ describe('multiaddr matcher', () => {
8585
8686 const exactQUIC = [
8787 '/ip4/1.2.3.4/udp/1234/quic' ,
88- '/ip6/::/udp/1234/quic'
88+ '/ip4/1.2.3.4/udp/1234/quic/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64' ,
89+ '/ip6/::/udp/1234/quic' ,
90+ '/ip6/::/udp/1234/quic/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64'
8991 ]
9092
9193 const goodQUIC = [
@@ -100,6 +102,30 @@ describe('multiaddr matcher', () => {
100102 '/quic'
101103 ]
102104
105+ const exactQUICv1 = [
106+ '/ip4/1.2.3.4/udp/1234/quic-v1' ,
107+ '/ip4/1.2.3.4/udp/1234/quic-v1/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64' ,
108+ '/ip6/::/udp/1234/quic-v1' ,
109+ '/ip6/::/udp/1234/quic-v1/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64'
110+ ]
111+
112+ const goodQUICv1 = [
113+ ...exactQUICv1 ,
114+ '/ip4/1.2.3.4/udp/1234/quic-v1/webtransport/certhash/uEiAeP0OEmBbGVTH5Bhnm3WopwRNSQ0et46xNkn2dIagnGw' ,
115+ '/dns/google.com/udp/1234/quic-v1/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64'
116+ ]
117+
118+ const badQUICv1 = [
119+ '/ip4/0.0.0.0/tcp/12345/quic-v1' ,
120+ '/ip6/1.2.3.4/ip4/0.0.0.0/udp/1234/quic-v1' ,
121+ '/quic-v1' ,
122+ '/quic' ,
123+ '/ip4/1.2.3.4/udp/1234/quic' ,
124+ '/ip4/1.2.3.4/udp/1234/quic/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64' ,
125+ '/ip6/::/udp/1234/quic' ,
126+ '/ip6/::/udp/1234/quic/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64'
127+ ]
128+
103129 const exactWS = [
104130 '/dnsaddr/ipfs.io/ws' ,
105131 '/dns4/ipfs.io/ws' ,
@@ -382,6 +408,12 @@ describe('multiaddr matcher', () => {
382408 assertMismatches ( mafmt . QUIC , badQUIC )
383409 } )
384410
411+ it ( 'QUICv1 addresses' , ( ) => {
412+ assertMatches ( mafmt . QUICV1 , goodQUICv1 )
413+ assertExactMatches ( mafmt . QUICV1 , exactQUICv1 )
414+ assertMismatches ( mafmt . QUICV1 , badQUICv1 )
415+ } )
416+
385417 it ( 'WebSockets addresses' , ( ) => {
386418 assertMatches ( mafmt . WebSockets , goodWS )
387419 assertExactMatches ( mafmt . WebSockets , exactWS )
0 commit comments