diff --git a/scripts/system_tests_utils.ts b/scripts/system_tests_utils.ts index 1c29d058060..50c5776ca92 100644 --- a/scripts/system_tests_utils.ts +++ b/scripts/system_tests_utils.ts @@ -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'; @@ -81,6 +81,16 @@ export const getSystemTestProvider = (url); + + } else if (url.includes('ws')) { + + const reconnectionOptions = { + delay: 100, + autoReconnect: true, + maxAttempts: 30, + }; + + return new WebSocketProvider(url, {}, reconnectionOptions); } return url; };