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

Commit a942fb9

Browse files
committed
fix: change secondary node to Go
1 parent b37b2e7 commit a942fb9

File tree

7 files changed

+12
-16
lines changed

7 files changed

+12
-16
lines changed

src/bitswap/stat.js

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

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

src/bitswap/wantlist.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ module.exports = (common, options) => {
2222
before(async () => {
2323
ipfsA = await common.setup()
2424
ipfsB = await common.setup({ type: 'js' })
25-
await ipfsA.swarm.connect(ipfsB.peerId.addresses[0])
2625
// Add key to the wantlist for ipfsB
2726
ipfsB.block.get(key, () => {})
27+
await ipfsA.swarm.connect(ipfsB.peerId.addresses[0])
2828
})
2929

3030
after(() => common.teardown())
@@ -33,15 +33,15 @@ module.exports = (common, options) => {
3333
return waitForWantlistKey(ipfsB, key)
3434
})
3535

36-
it('should get the wantlist by peer ID for a diffreent node', () => {
36+
it('should get the wantlist by peer ID for a different node', () => {
3737
return waitForWantlistKey(ipfsA, key, { peerId: ipfsB.peerId.id })
3838
})
3939

4040
it('should not get the wantlist when offline', async () => {
4141
const node = await common.node()
4242
await node.stop()
4343

44-
return expect(node.bitswap.stat()).to.eventually.be.rejected()
44+
return expect(node.api.bitswap.stat()).to.eventually.be.rejected()
4545
})
4646
})
4747
}

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
@@ -26,11 +26,9 @@ module.exports = (common, options) => {
2626

2727
before(async () => {
2828
ipfs1 = await common.setup()
29-
ipfs2 = await common.setup({ type: 'js' })
29+
ipfs2 = await common.setup({ type: 'go' })
3030
})
3131

32-
after(() => common.teardown())
33-
3432
beforeEach(() => {
3533
topic = getTopic()
3634
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)