From bd918dd89c8eebe1ca58f2295eb24c1521a96212 Mon Sep 17 00:00:00 2001 From: Eric <5089238+emizzle@users.noreply.github.com> Date: Wed, 4 Jun 2025 16:43:54 +1000 Subject: [PATCH] update to websockets addresses for hardhat connection Also, catch exceptions on JsonRpcProvider.close, which should not need to be done, as this routine should not raise any exceptions. --- tests/integration/multinodes.nim | 8 ++++++-- tests/integration/testcli.nim | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/integration/multinodes.nim b/tests/integration/multinodes.nim index 1f2728ca..552e7c37 100644 --- a/tests/integration/multinodes.nim +++ b/tests/integration/multinodes.nim @@ -90,7 +90,7 @@ template multinodesuite*(suiteName: string, body: untyped) = # .withEthProvider("ws://localhost:8545") # .some, # ... - var jsonRpcProviderUrl = "http://127.0.0.1:" & $HardhatPort + var jsonRpcProviderUrl = "ws://localhost:" & $HardhatPort var running {.inject, used.}: seq[RunningNode] var bootstrapNodes: seq[string] let starttime = now().format("yyyy-MM-dd'_'HH:mm:ss") @@ -324,7 +324,11 @@ template multinodesuite*(suiteName: string, body: untyped) = except ProviderError as e: error "Failed to revert hardhat state during teardown", error = e.msg - await ethProvider.close() + # TODO: JsonRpcProvider.close should NOT raise any exceptions + try: + await ethProvider.close() + except CatchableError: + discard running = @[] diff --git a/tests/integration/testcli.nim b/tests/integration/testcli.nim index 4fd33378..f5dd3e62 100644 --- a/tests/integration/testcli.nim +++ b/tests/integration/testcli.nim @@ -74,7 +74,7 @@ asyncchecksuite "Command line interface": let node = await startCodex( @[ "persistence", - "--eth-provider=" & "http://127.0.0.1:" & $HardhatPort, + "--eth-provider=" & "ws://localhost:" & $HardhatPort, "--eth-private-key=" & unsafeKeyFile, ] ) @@ -98,7 +98,7 @@ asyncchecksuite "Command line interface": let node = await startCodex( @[ "persistence", - "--eth-provider=" & "http://127.0.0.1:" & $HardhatPort, + "--eth-provider=" & "ws://localhost:" & $HardhatPort, "prover", marketplaceArg, "--circom-r1cs=tests/circuits/fixtures/proof_main.r1cs", @@ -111,7 +111,7 @@ asyncchecksuite "Command line interface": let node = await startCodex( @[ "persistence", - "--eth-provider=" & "http://127.0.0.1:" & $HardhatPort, + "--eth-provider=" & "ws://localhost:" & $HardhatPort, "prover", marketplaceArg, "--circom-r1cs=tests/circuits/fixtures/proof_main.r1cs",