Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 6248ec1

Browse files
author
Alan Shaw
authored
fix: swarm.peers latency value when unknown (#2336)
go-ipfs returns "n/a" when latency is unknown. This change restores compatibility. License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
1 parent 128efec commit 6248ec1

File tree

4 files changed

+46
-12
lines changed

4 files changed

+46
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
"execa": "^2.0.3",
191191
"form-data": "^2.5.0",
192192
"hat": "0.0.3",
193-
"interface-ipfs-core": "~0.107.3",
193+
"interface-ipfs-core": "^0.109.1",
194194
"ipfsd-ctl": "^0.43.0",
195195
"libp2p-websocket-star": "~0.10.2",
196196
"ncp": "^2.0.0",

src/core/components/swarm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = function swarm (self) {
3434
peer: peer.id
3535
}
3636
if (verbose) {
37-
tupple.latency = 'unknown'
37+
tupple.latency = 'n/a'
3838
}
3939

4040
peers.push(tupple)

test/core/interface.spec.js

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,20 @@ describe('interface-ipfs-core tests', function () {
1717
tests.bootstrap(defaultCommonFactory)
1818

1919
tests.config(defaultCommonFactory, {
20-
skip: [{
21-
name: 'should set a number',
22-
reason: 'Failing - needs to be fixed'
23-
}]
20+
skip: [
21+
{
22+
name: 'should set a number',
23+
reason: 'Failing - needs to be fixed'
24+
},
25+
{
26+
name: 'should output changes but not save them for dry run',
27+
reason: 'TODO unskip when https://github.com/ipfs/js-ipfs/pull/2165 is merged'
28+
},
29+
{
30+
name: 'should set a config profile',
31+
reason: 'TODO unskip when https://github.com/ipfs/js-ipfs/pull/2165 is merged'
32+
}
33+
]
2434
})
2535

2636
tests.dag(defaultCommonFactory)
@@ -119,7 +129,14 @@ describe('interface-ipfs-core tests', function () {
119129
}
120130
}))
121131

122-
tests.object(defaultCommonFactory)
132+
tests.object(defaultCommonFactory, {
133+
skip: [
134+
{
135+
name: 'should respect timeout option',
136+
reason: 'js-ipfs doesn\'t support timeout yet'
137+
}
138+
]
139+
})
123140

124141
tests.pin(defaultCommonFactory)
125142

test/http-api/interface.js

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,20 @@ describe('interface-ipfs-core over ipfs-http-client tests', () => {
1717
tests.bootstrap(defaultCommonFactory)
1818

1919
tests.config(defaultCommonFactory, {
20-
skip: [{
21-
name: 'should set a number',
22-
reason: 'Failing - needs to be fixed'
23-
}]
20+
skip: [
21+
{
22+
name: 'should set a number',
23+
reason: 'Failing - needs to be fixed'
24+
},
25+
{
26+
name: 'should output changes but not save them for dry run',
27+
reason: 'TODO unskip when https://github.com/ipfs/js-ipfs/pull/2165 is merged'
28+
},
29+
{
30+
name: 'should set a config profile',
31+
reason: 'TODO unskip when https://github.com/ipfs/js-ipfs/pull/2165 is merged'
32+
}
33+
]
2434
})
2535

2636
tests.dag(defaultCommonFactory, {
@@ -122,7 +132,14 @@ describe('interface-ipfs-core over ipfs-http-client tests', () => {
122132
}
123133
}))
124134

125-
tests.object(defaultCommonFactory)
135+
tests.object(defaultCommonFactory, {
136+
skip: [
137+
{
138+
name: 'should respect timeout option',
139+
reason: 'js-ipfs doesn\'t support timeout yet'
140+
}
141+
]
142+
})
126143

127144
tests.pin(defaultCommonFactory)
128145

0 commit comments

Comments
 (0)