Skip to content

Commit

Permalink
ws config
Browse files Browse the repository at this point in the history
  • Loading branch information
jdevcs committed Oct 11, 2023
1 parent 2a468b1 commit 9faa965
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/system_tests_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import {
// eslint-disable-next-line import/no-extraneous-dependencies
import { Personal } from 'web3-eth-personal';
// eslint-disable-next-line import/no-extraneous-dependencies
import Web3 from 'web3';
import Web3, { WebSocketProvider } from 'web3';

// eslint-disable-next-line import/no-extraneous-dependencies
import { NonPayableMethodObject } from 'web3-eth-contract';
Expand Down Expand Up @@ -81,6 +81,16 @@ export const getSystemTestProvider = <API extends Web3APISpec = Web3EthExecution
const url = getSystemTestProviderUrl();
if (url.includes('ipc')) {
return new IpcProvider<API>(url);

} else if (url.includes('ws')) {

const reconnectionOptions = {
delay: 100,
autoReconnect: true,
maxAttempts: 30,
};

return new WebSocketProvider<API>(url, {}, reconnectionOptions);
}
return url;
};
Expand Down

0 comments on commit 9faa965

Please sign in to comment.