@@ -66,10 +66,12 @@ func TestForward(t *testing.T) {
6666 bootstrap := []string {
6767 // peer with old key (should be filtered out)
6868 "/ip4/178.62.158.247/tcp/4001/p2p/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd" ,
69- // peer with unknown key (should be included)
70- "/ip4/178.62.158.248/tcp/4001/p2p/QmSomeNewKeygSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd " ,
69+ // peer with unknown key (should be included, /ipfs/ replaced with /p2p/ )
70+ "/ip4/178.62.158.248/tcp/4001/ipfs/QmSomeNewKeygSp2LA3dPaeykiS1J6DifTC88f5uV562wK " ,
7171 // unrecognized format (should be included)
7272 "/ip4/178.62.158.248/tcp/4001/wut/some-new-format" ,
73+ // peer with /dns/ipfs.my-domain.com (should be included, "ipfs" in domain should not be changed)
74+ "/dns4/ipfs-bootstrap.com/tcp/4001/ipfs/Qm1234567KeygSp2LA3dPaeykiS1J6DifTC88f5u123456" ,
7375 }
7476 exp := []string {
7577 // new dnsaddr peers
@@ -78,9 +80,11 @@ func TestForward(t *testing.T) {
7880 "/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb" ,
7981 "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt" ,
8082 // peer with unknown key
81- "/ip4/178.62.158.248/tcp/4001/p2p/QmSomeNewKeygSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd " ,
83+ "/ip4/178.62.158.248/tcp/4001/p2p/QmSomeNewKeygSp2LA3dPaeykiS1J6DifTC88f5uV562wK " ,
8284 // unrecognized format
8385 "/ip4/178.62.158.248/tcp/4001/wut/some-new-format" ,
86+ // peer with /dns/ipfs.my-domain.com
87+ "/dns4/ipfs-bootstrap.com/tcp/4001/p2p/Qm1234567KeygSp2LA3dPaeykiS1J6DifTC88f5u123456" ,
8488 }
8589 if res := ver7to8 (bootstrap ); ! arrayMatch (exp , res ) {
8690 fmt .Println (res )
0 commit comments