@@ -9,17 +9,7 @@ func TestMigrationDecode(t *testing.T) {
9
9
str := `
10
10
{
11
11
"DownloadSources": ["IPFS", "HTTP", "127.0.0.1"],
12
- "Keep": "cache",
13
- "Peers": [
14
- {
15
- "ID": "12D3KooWGC6TvWhfapngX6wvJHMYvKpDMXPb3ZnCZ6dMoaMtimQ5",
16
- "Addrs": ["/ip4/127.0.0.1/tcp/4001", "/ip4/127.0.0.1/udp/4001/quic"]
17
- },
18
- {
19
- "ID": "12D3KooWGC6TvWhfajpgX6wvJHMYvKpDMXPb3ZnCZ6dMoaMtimQ7",
20
- "Addrs": ["/ip4/10.0.0.2/tcp/4001"]
21
- }
22
- ]
12
+ "Keep": "cache"
23
13
}
24
14
`
25
15
@@ -41,30 +31,4 @@ func TestMigrationDecode(t *testing.T) {
41
31
if cfg .Keep != "cache" {
42
32
t .Error ("wrong value for Keep" )
43
33
}
44
-
45
- if len (cfg .Peers ) != 2 {
46
- t .Fatal ("wrong number of peers" )
47
- }
48
-
49
- peer := cfg .Peers [0 ]
50
- if peer .ID .String () != "12D3KooWGC6TvWhfapngX6wvJHMYvKpDMXPb3ZnCZ6dMoaMtimQ5" {
51
- t .Errorf ("wrong ID for first peer" )
52
- }
53
- if len (peer .Addrs ) != 2 {
54
- t .Error ("wrong number of addrs for first peer" )
55
- }
56
- if peer .Addrs [0 ].String () != "/ip4/127.0.0.1/tcp/4001" {
57
- t .Error ("wrong first addr for first peer" )
58
- }
59
- if peer .Addrs [1 ].String () != "/ip4/127.0.0.1/udp/4001/quic" {
60
- t .Error ("wrong second addr for first peer" )
61
- }
62
-
63
- peer = cfg .Peers [1 ]
64
- if len (peer .Addrs ) != 1 {
65
- t .Fatal ("wrong number of addrs for second peer" )
66
- }
67
- if peer .Addrs [0 ].String () != "/ip4/10.0.0.2/tcp/4001" {
68
- t .Error ("wrong first addr for second peer" )
69
- }
70
34
}
0 commit comments