@@ -85,7 +85,9 @@ describe('multiaddr matcher', () => {
85
85
86
86
const exactQUIC = [
87
87
'/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'
89
91
]
90
92
91
93
const goodQUIC = [
@@ -100,6 +102,30 @@ describe('multiaddr matcher', () => {
100
102
'/quic'
101
103
]
102
104
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
+
103
129
const exactWS = [
104
130
'/dnsaddr/ipfs.io/ws' ,
105
131
'/dns4/ipfs.io/ws' ,
@@ -382,6 +408,12 @@ describe('multiaddr matcher', () => {
382
408
assertMismatches ( mafmt . QUIC , badQUIC )
383
409
} )
384
410
411
+ it ( 'QUICv1 addresses' , ( ) => {
412
+ assertMatches ( mafmt . QUICV1 , goodQUICv1 )
413
+ assertExactMatches ( mafmt . QUICV1 , exactQUICv1 )
414
+ assertMismatches ( mafmt . QUICV1 , badQUICv1 )
415
+ } )
416
+
385
417
it ( 'WebSockets addresses' , ( ) => {
386
418
assertMatches ( mafmt . WebSockets , goodWS )
387
419
assertExactMatches ( mafmt . WebSockets , exactWS )
0 commit comments