From 3e29d414d27ed665b6830277220a3ed8b806b4ea Mon Sep 17 00:00:00 2001 From: Eric <5089238+emizzle@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:33:54 +1100 Subject: [PATCH] pass hardhat port to ethersuite # Conflicts: # tests/ethertest.nim --- tests/ethertest.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/ethertest.nim b/tests/ethertest.nim index 2cab8bf5..636760a1 100644 --- a/tests/ethertest.nim +++ b/tests/ethertest.nim @@ -5,6 +5,8 @@ import pkg/chronos import ./asynctest import ./checktest +const HardhatPort {.intdefine.}: int = 8545 + ## Unit testing suite that sets up an Ethereum testing environment. ## Injects a `ethProvider` instance, and a list of `accounts`. ## Calls the `evm_snapshot` and `evm_revert` methods to ensure that any @@ -16,7 +18,7 @@ template ethersuite*(name, body) = var snapshot: JsonNode setup: - ethProvider = JsonRpcProvider.new("ws://localhost:8545") + ethProvider = JsonRpcProvider.new("ws://localhost:" & $HardhatPort) snapshot = await send(ethProvider, "evm_snapshot") accounts = await ethProvider.listAccounts() teardown: