integration: workaround for hardhat issue

Subscriptions expire after 5 minutes when using
websockets. Use http and polling instead.
This commit is contained in:
Mark Spanbroek 2024-03-03 18:25:43 +01:00
parent bb2bcd8ac0
commit c4e3c2072e
No known key found for this signature in database
GPG Key ID: FBE3E9548D427C00
1 changed files with 4 additions and 1 deletions

View File

@ -261,7 +261,10 @@ template multinodesuite*(name: string, body: untyped) =
quit(1)
try:
ethProvider = JsonRpcProvider.new("ws://localhost:8545")
# Workaround for https://github.com/NomicFoundation/hardhat/issues/2053
# Do not use websockets, but use http and polling to stop subscriptions
# from being removed after 5 minutes
ethProvider = JsonRpcProvider.new("http://localhost:8545")
# if hardhat was NOT started by the test, take a snapshot so it can be
# reverted in the test teardown
if nodeConfigs.hardhat.isNone: