From 9faa965dc05c06fb98f71a17fb0d71f902ba740c Mon Sep 17 00:00:00 2001 From: jdevcs Date: Wed, 11 Oct 2023 18:26:39 +0200 Subject: [PATCH] ws config --- scripts/system_tests_utils.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; };