From 5c25af5886bd27ff670649dfb779713b5a7bfacc Mon Sep 17 00:00:00 2001 From: nivida Date: Sat, 3 Aug 2019 14:48:24 +0200 Subject: [PATCH] reconnectionTimeout renamed to reconnectDelay --- .../src/factories/ProvidersModuleFactory.js | 2 +- .../src/providers/WebsocketProvider.js | 12 ++++++------ .../tests/src/providers/WebsocketProviderTest.js | 2 +- packages/web3-providers/types/index.d.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/web3-providers/src/factories/ProvidersModuleFactory.js b/packages/web3-providers/src/factories/ProvidersModuleFactory.js index c848fa5f31b..69005963965 100644 --- a/packages/web3-providers/src/factories/ProvidersModuleFactory.js +++ b/packages/web3-providers/src/factories/ProvidersModuleFactory.js @@ -143,7 +143,7 @@ export default class ProvidersModuleFactory { options.clientConfig ), options.timeout, - options.reconnectionTimeout + options.reconnectDelay ); } diff --git a/packages/web3-providers/src/providers/WebsocketProvider.js b/packages/web3-providers/src/providers/WebsocketProvider.js index ba071dafec1..a0dca04fa0d 100644 --- a/packages/web3-providers/src/providers/WebsocketProvider.js +++ b/packages/web3-providers/src/providers/WebsocketProvider.js @@ -26,15 +26,15 @@ import isArray from 'lodash/isArray'; export default class WebsocketProvider extends AbstractSocketProvider { /** * @param {WebSocket} connection - * @param {Number} responseTimeout - * @param {Number} reconnectionTimeout + * @param {Number} timeout + * @param {Number} reconnectDelay * * @constructor */ - constructor(connection, responseTimeout, reconnectionTimeout = 5000) { - super(connection, responseTimeout); + constructor(connection, timeout, reconnectDelay = 5000) { + super(connection, timeout); this.host = this.connection.url; - this.reconnectionTimeout = reconnectionTimeout; + this.reconnectDelay = reconnectDelay; this.reconnecting = false; } @@ -126,7 +126,7 @@ export default class WebsocketProvider extends AbstractSocketProvider { this.connection = connection; this.registerEventListeners(); - }, this.reconnectionTimeout); + }, this.reconnectDelay); } /** diff --git a/packages/web3-providers/tests/src/providers/WebsocketProviderTest.js b/packages/web3-providers/tests/src/providers/WebsocketProviderTest.js index f3c59b52e97..1da19b629ec 100644 --- a/packages/web3-providers/tests/src/providers/WebsocketProviderTest.js +++ b/packages/web3-providers/tests/src/providers/WebsocketProviderTest.js @@ -23,7 +23,7 @@ describe('WebsocketProviderTest', () => { expect(websocketProvider.timeout).toEqual(1); - expect(websocketProvider.reconnectionTimeout).toEqual(1); + expect(websocketProvider.reconnectDelay).toEqual(1); expect(socketMock.addEventListener.mock.calls[0][0]).toEqual('message'); expect(socketMock.addEventListener.mock.calls[0][1]).toBeInstanceOf(Function); diff --git a/packages/web3-providers/types/index.d.ts b/packages/web3-providers/types/index.d.ts index 51f9714e6d4..b45e9cc221a 100644 --- a/packages/web3-providers/types/index.d.ts +++ b/packages/web3-providers/types/index.d.ts @@ -177,7 +177,7 @@ export interface HttpProviderOptions { export interface WebsocketProviderOptions { host?: string; timeout?: number; - reconnectionTimeout?: number; + reconnectDelay?: number; headers?: {}; protocol?: string; clientConfig?: string;