Skip to content

Commit

Permalink
reconnectionTimeout renamed to reconnectDelay
Browse files Browse the repository at this point in the history
  • Loading branch information
nivida committed Aug 3, 2019
1 parent a563af0 commit 5c25af5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export default class ProvidersModuleFactory {
options.clientConfig
),
options.timeout,
options.reconnectionTimeout
options.reconnectDelay
);
}

Expand Down
12 changes: 6 additions & 6 deletions packages/web3-providers/src/providers/WebsocketProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -126,7 +126,7 @@ export default class WebsocketProvider extends AbstractSocketProvider {

this.connection = connection;
this.registerEventListeners();
}, this.reconnectionTimeout);
}, this.reconnectDelay);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-providers/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export interface HttpProviderOptions {
export interface WebsocketProviderOptions {
host?: string;
timeout?: number;
reconnectionTimeout?: number;
reconnectDelay?: number;
headers?: {};
protocol?: string;
clientConfig?: string;
Expand Down

0 comments on commit 5c25af5

Please sign in to comment.