Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 5d9bbd8

Browse files
committed
fix: change secondary node to Go
1 parent beff1a2 commit 5d9bbd8

File tree

7 files changed

+10
-15
lines changed

7 files changed

+10
-15
lines changed

src/bitswap/stat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = (common, options) => {
3232
const node = await common.node()
3333
await node.stop()
3434

35-
return expect(node.bitswap.stat()).to.eventually.be.rejected()
35+
return expect(node.api.bitswap.stat()).to.eventually.be.rejected()
3636
})
3737
})
3838
}

src/bitswap/wantlist.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ module.exports = (common, options) => {
2626

2727
ipfsA = await common.setup()
2828
ipfsB = await common.setup({ type: 'js' })
29-
await ipfsA.swarm.connect(ipfsB.peerId.addresses[0])
3029
// Add key to the wantlist for ipfsB
3130
ipfsB.block.get(key).catch(() => {})
3231
})
@@ -52,7 +51,7 @@ module.exports = (common, options) => {
5251
const node = await common.node()
5352
await node.stop()
5453

55-
return expect(node.bitswap.wantlist()).to.eventually.be.rejected()
54+
return expect(node.api.bitswap.stat()).to.eventually.be.rejected()
5655
})
5756
})
5857
}

src/miscellaneous/resolve.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,8 @@ module.exports = (common, options) => {
8181

8282
it('should resolve IPNS link recursively', async function () {
8383
this.timeout(20 * 1000)
84-
const node = await common.setup({ type: 'js' })
84+
const node = await common.setup({ type: 'go' })
8585
await ipfs.swarm.connect(node.peerId.addresses[0])
86-
8786
const [{ path }] = await ipfs.add(Buffer.from('should resolve a record recursive === true'))
8887
const { id: keyId } = await ipfs.key.gen('key-name', { type: 'rsa', size: 2048 })
8988

src/miscellaneous/stop.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ module.exports = (common, options) => {
1919
const ipfs = await common.node()
2020

2121
await ipfs.stop()
22-
2322
// Trying to stop an already stopped node should return an error
2423
// as the node can't respond to requests anymore
25-
return expect(ipfs.stop()).to.eventually.be.rejected()
24+
return expect(ipfs.api.stop()).to.eventually.be.rejected()
2625
})
2726
})
2827
}

src/pubsub/peers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ module.exports = (common, options) => {
2323
let subscribedTopics = []
2424
before(async () => {
2525
ipfs1 = await common.setup()
26-
ipfs2 = await common.setup({ type: 'js' })
27-
ipfs3 = await common.setup({ type: 'js' })
26+
ipfs2 = await common.setup({ type: 'go' })
27+
ipfs3 = await common.setup({ type: 'go' })
2828

2929
const ipfs2Addr = ipfs2.peerId.addresses.find((a) => a.includes('127.0.0.1'))
3030
const ipfs3Addr = ipfs3.peerId.addresses.find((a) => a.includes('127.0.0.1'))

src/pubsub/subscribe.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ module.exports = (common, options) => {
3030
this.timeout(100 * 1000)
3131

3232
ipfs1 = await common.setup()
33-
ipfs2 = await common.setup({ type: 'js' })
33+
ipfs2 = await common.setup({ type: 'go' })
3434
})
3535

36-
after(() => common.teardown())
37-
3836
beforeEach(() => {
3937
topic = getTopic()
4038
subscribedTopics = [topic]

src/swarm/peers.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = (common, options) => {
2323

2424
before(async () => {
2525
ipfsA = await common.setup()
26-
ipfsB = await common.setup({ type: 'js' })
26+
ipfsB = await common.setup({ type: 'go' })
2727
await ipfsA.swarm.connect(ipfsB.peerId.addresses[0])
2828
await delay(60 * 1000) // wait for open streams in the connection available
2929
})
@@ -85,7 +85,7 @@ module.exports = (common, options) => {
8585

8686
it('should list peers only once', async () => {
8787
const nodeA = await common.setup()
88-
const nodeB = await common.setup({ type: 'js' })
88+
const nodeB = await common.setup({ type: 'go' })
8989
await nodeA.swarm.connect(nodeB.peerId.addresses[0])
9090
await delay(1000)
9191
const peersA = await nodeA.swarm.peers()
@@ -105,7 +105,7 @@ module.exports = (common, options) => {
105105
'/ip4/127.0.0.1/tcp/26546/ws'
106106
])
107107
const nodeA = await common.setup({ ipfsOptions: { config: configA } })
108-
const nodeB = await common.setup({ type: 'js', ipfsOptions: { config: configB } })
108+
const nodeB = await common.setup({ type: 'go', ipfsOptions: { config: configB } })
109109
await nodeA.swarm.connect(nodeB.peerId.addresses[0])
110110
await delay(1000)
111111
const peersA = await nodeA.swarm.peers()

0 commit comments

Comments
 (0)