diff --git a/src/bitswap/stat.js b/src/bitswap/stat.js index d844595a..912a5caa 100644 --- a/src/bitswap/stat.js +++ b/src/bitswap/stat.js @@ -31,7 +31,7 @@ module.exports = (common, options) => { const node = await common.node() await node.stop() - return expect(node.bitswap.stat()).to.eventually.be.rejected() + return expect(node.api.bitswap.stat()).to.eventually.be.rejected() }) }) } diff --git a/src/bitswap/wantlist.js b/src/bitswap/wantlist.js index aa4daae2..f5eaae30 100644 --- a/src/bitswap/wantlist.js +++ b/src/bitswap/wantlist.js @@ -22,9 +22,9 @@ module.exports = (common, options) => { before(async () => { ipfsA = await common.setup() ipfsB = await common.setup({ type: 'js' }) - await ipfsA.swarm.connect(ipfsB.peerId.addresses[0]) // Add key to the wantlist for ipfsB ipfsB.block.get(key, () => {}) + await ipfsA.swarm.connect(ipfsB.peerId.addresses[0]) }) after(() => common.teardown()) @@ -33,7 +33,7 @@ module.exports = (common, options) => { return waitForWantlistKey(ipfsB, key) }) - it('should get the wantlist by peer ID for a diffreent node', () => { + it('should get the wantlist by peer ID for a different node', () => { return waitForWantlistKey(ipfsA, key, { peerId: ipfsB.peerId.id }) }) @@ -41,7 +41,7 @@ module.exports = (common, options) => { const node = await common.node() await node.stop() - return expect(node.bitswap.stat()).to.eventually.be.rejected() + return expect(node.api.bitswap.stat()).to.eventually.be.rejected() }) }) } diff --git a/src/miscellaneous/resolve.js b/src/miscellaneous/resolve.js index 0bd003c5..8d271ef1 100644 --- a/src/miscellaneous/resolve.js +++ b/src/miscellaneous/resolve.js @@ -81,9 +81,8 @@ module.exports = (common, options) => { it('should resolve IPNS link recursively', async function () { this.timeout(20 * 1000) - const node = await common.setup({ type: 'js' }) + const node = await common.setup({ type: 'go' }) await ipfs.swarm.connect(node.peerId.addresses[0]) - const [{ path }] = await ipfs.add(Buffer.from('should resolve a record recursive === true')) const { id: keyId } = await ipfs.key.gen('key-name', { type: 'rsa', size: 2048 }) diff --git a/src/miscellaneous/stop.js b/src/miscellaneous/stop.js index 4e9e2f9b..7f1d8458 100644 --- a/src/miscellaneous/stop.js +++ b/src/miscellaneous/stop.js @@ -19,10 +19,9 @@ module.exports = (common, options) => { const ipfs = await common.node() await ipfs.stop() - // Trying to stop an already stopped node should return an error // as the node can't respond to requests anymore - return expect(ipfs.stop()).to.eventually.be.rejected() + return expect(ipfs.api.stop()).to.eventually.be.rejected() }) }) } diff --git a/src/pubsub/peers.js b/src/pubsub/peers.js index 38f148f1..f9344741 100644 --- a/src/pubsub/peers.js +++ b/src/pubsub/peers.js @@ -23,8 +23,8 @@ module.exports = (common, options) => { let subscribedTopics = [] before(async () => { ipfs1 = await common.setup() - ipfs2 = await common.setup({ type: 'js' }) - ipfs3 = await common.setup({ type: 'js' }) + ipfs2 = await common.setup({ type: 'go' }) + ipfs3 = await common.setup({ type: 'go' }) const ipfs2Addr = ipfs2.peerId.addresses.find((a) => a.includes('127.0.0.1')) const ipfs3Addr = ipfs3.peerId.addresses.find((a) => a.includes('127.0.0.1')) diff --git a/src/pubsub/subscribe.js b/src/pubsub/subscribe.js index 3dbdf6da..fedae10d 100644 --- a/src/pubsub/subscribe.js +++ b/src/pubsub/subscribe.js @@ -26,11 +26,9 @@ module.exports = (common, options) => { before(async () => { ipfs1 = await common.setup() - ipfs2 = await common.setup({ type: 'js' }) + ipfs2 = await common.setup({ type: 'go' }) }) - after(() => common.teardown()) - beforeEach(() => { topic = getTopic() subscribedTopics = [topic] diff --git a/src/swarm/peers.js b/src/swarm/peers.js index 485e1bc2..9ec5c7b7 100644 --- a/src/swarm/peers.js +++ b/src/swarm/peers.js @@ -23,7 +23,7 @@ module.exports = (common, options) => { before(async () => { ipfsA = await common.setup() - ipfsB = await common.setup({ type: 'js' }) + ipfsB = await common.setup({ type: 'go' }) await ipfsA.swarm.connect(ipfsB.peerId.addresses[0]) await delay(60 * 1000) // wait for open streams in the connection available }) @@ -85,7 +85,7 @@ module.exports = (common, options) => { it('should list peers only once', async () => { const nodeA = await common.setup() - const nodeB = await common.setup({ type: 'js' }) + const nodeB = await common.setup({ type: 'go' }) await nodeA.swarm.connect(nodeB.peerId.addresses[0]) await delay(1000) const peersA = await nodeA.swarm.peers() @@ -105,7 +105,7 @@ module.exports = (common, options) => { '/ip4/127.0.0.1/tcp/26546/ws' ]) const nodeA = await common.setup({ ipfsOptions: { config: configA } }) - const nodeB = await common.setup({ type: 'js', ipfsOptions: { config: configB } }) + const nodeB = await common.setup({ type: 'go', ipfsOptions: { config: configB } }) await nodeA.swarm.connect(nodeB.peerId.addresses[0]) await delay(1000) const peersA = await nodeA.swarm.peers()