diff --git a/catapult-sdk/package.json b/catapult-sdk/package.json index db6a6c868..59d9d1b77 100644 --- a/catapult-sdk/package.json +++ b/catapult-sdk/package.json @@ -1,6 +1,6 @@ { "name": "catapult-sdk", - "version": "0.7.20.30", + "version": "0.7.20.31", "description": "Catapult SDK core", "main": "_build/index.js", "scripts": { diff --git a/rest/package.json b/rest/package.json index f2acadfa6..5f058d31c 100644 --- a/rest/package.json +++ b/rest/package.json @@ -1,6 +1,6 @@ { "name": "catapult-api-rest", - "version": "1.0.20.30", + "version": "1.0.20.31", "description": "", "main": "_build/index.js", "scripts": { diff --git a/rest/src/connection/catapultConnection.js b/rest/src/connection/catapultConnection.js index 74d5f1e66..a6c043d07 100644 --- a/rest/src/connection/catapultConnection.js +++ b/rest/src/connection/catapultConnection.js @@ -68,7 +68,7 @@ module.exports = { packetParser.onPacket(packet => { connection.removeListener('close', innerReject); - connection.destroy(); + connection.end(); resolve(packet); }); }); @@ -78,7 +78,7 @@ module.exports = { const timeout = new Promise((resolve, reject) => { const id = setTimeout(() => { clearTimeout(id); - connection.destroy(); + connection.end(); rejectOnClose(reject)(); }, timeoutMs); }); diff --git a/rest/test/connection/catapultConnection_spec.js b/rest/test/connection/catapultConnection_spec.js index 26bfed896..0d41ce05e 100644 --- a/rest/test/connection/catapultConnection_spec.js +++ b/rest/test/connection/catapultConnection_spec.js @@ -23,9 +23,9 @@ const { expect } = require('chai'); describe('catapult connection', () => { const createTestContext = () => { - let isDestroyed = false; + let isEnded = false; const context = { - isDestroyed: () => isDestroyed, + isEnded: () => isEnded, onCalls: {}, onceCalls: {}, writeCalls: [], @@ -47,8 +47,8 @@ describe('catapult connection', () => { emit: name => context.onCalls[name](), - destroy: () => { - isDestroyed = true; + end: () => { + isEnded = true; } } }; @@ -142,7 +142,7 @@ describe('catapult connection', () => { }); expect(context.removeCalls).to.have.all.keys('close'); expect(context.removeCalls.close).to.equal(context.onceCalls.close); - expect(context.isDestroyed()).to.be.equal(true); + expect(context.isEnded()).to.be.equal(true); }); }); @@ -173,7 +173,7 @@ describe('catapult connection', () => { // Assert: expect(err.statusCode).to.equal(503); expect(err.message).to.equal('connection failed'); - expect(context.isDestroyed()).to.be.equal(true); + expect(context.isEnded()).to.be.equal(true); }); });