Use websockets for integration tests
Use workaround in hardhat to ensure that subscriptions do not time out after 5 minutes
This commit is contained in:
parent
703b943175
commit
9539d0ebba
|
@ -196,7 +196,6 @@ template multinodesuite*(name: string, body: untyped) =
|
||||||
proc startClientNode(conf: CodexConfig): Future[NodeProcess] {.async.} =
|
proc startClientNode(conf: CodexConfig): Future[NodeProcess] {.async.} =
|
||||||
let clientIdx = clients().len
|
let clientIdx = clients().len
|
||||||
var config = conf
|
var config = conf
|
||||||
config.addCliOption(StartUpCmd.persistence, "--eth-provider", "http://localhost:8545")
|
|
||||||
config.addCliOption(StartUpCmd.persistence, "--eth-account", $accounts[running.len])
|
config.addCliOption(StartUpCmd.persistence, "--eth-account", $accounts[running.len])
|
||||||
return await newCodexProcess(clientIdx, config, Role.Client)
|
return await newCodexProcess(clientIdx, config, Role.Client)
|
||||||
|
|
||||||
|
@ -204,7 +203,6 @@ template multinodesuite*(name: string, body: untyped) =
|
||||||
let providerIdx = providers().len
|
let providerIdx = providers().len
|
||||||
var config = conf
|
var config = conf
|
||||||
config.addCliOption("--bootstrap-node", bootstrap)
|
config.addCliOption("--bootstrap-node", bootstrap)
|
||||||
config.addCliOption(StartUpCmd.persistence, "--eth-provider", "http://localhost:8545")
|
|
||||||
config.addCliOption(StartUpCmd.persistence, "--eth-account", $accounts[running.len])
|
config.addCliOption(StartUpCmd.persistence, "--eth-account", $accounts[running.len])
|
||||||
config.addCliOption(PersistenceCmd.prover, "--circom-r1cs",
|
config.addCliOption(PersistenceCmd.prover, "--circom-r1cs",
|
||||||
"vendor/codex-contracts-eth/verifier/networks/hardhat/proof_main.r1cs")
|
"vendor/codex-contracts-eth/verifier/networks/hardhat/proof_main.r1cs")
|
||||||
|
@ -219,7 +217,6 @@ template multinodesuite*(name: string, body: untyped) =
|
||||||
let validatorIdx = validators().len
|
let validatorIdx = validators().len
|
||||||
var config = conf
|
var config = conf
|
||||||
config.addCliOption("--bootstrap-node", bootstrap)
|
config.addCliOption("--bootstrap-node", bootstrap)
|
||||||
config.addCliOption(StartUpCmd.persistence, "--eth-provider", "http://localhost:8545")
|
|
||||||
config.addCliOption(StartUpCmd.persistence, "--eth-account", $accounts[running.len])
|
config.addCliOption(StartUpCmd.persistence, "--eth-account", $accounts[running.len])
|
||||||
config.addCliOption(StartUpCmd.persistence, "--validator")
|
config.addCliOption(StartUpCmd.persistence, "--validator")
|
||||||
|
|
||||||
|
@ -264,10 +261,7 @@ template multinodesuite*(name: string, body: untyped) =
|
||||||
quit(1)
|
quit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Workaround for https://github.com/NomicFoundation/hardhat/issues/2053
|
ethProvider = JsonRpcProvider.new("ws://localhost:8545")
|
||||||
# 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
|
# if hardhat was NOT started by the test, take a snapshot so it can be
|
||||||
# reverted in the test teardown
|
# reverted in the test teardown
|
||||||
if nodeConfigs.hardhat.isNone:
|
if nodeConfigs.hardhat.isNone:
|
||||||
|
|
|
@ -43,7 +43,6 @@ template twonodessuite*(name: string, debug1, debug2: string, body) =
|
||||||
"--circom-r1cs=tests/circuits/fixtures/proof_main.r1cs",
|
"--circom-r1cs=tests/circuits/fixtures/proof_main.r1cs",
|
||||||
"--circom-wasm=tests/circuits/fixtures/proof_main.wasm",
|
"--circom-wasm=tests/circuits/fixtures/proof_main.wasm",
|
||||||
"--circom-zkey=tests/circuits/fixtures/proof_main.zkey",
|
"--circom-zkey=tests/circuits/fixtures/proof_main.zkey",
|
||||||
"--eth-provider=http://localhost:8545",
|
|
||||||
"--eth-account=" & $account1
|
"--eth-account=" & $account1
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -68,7 +67,6 @@ template twonodessuite*(name: string, debug1, debug2: string, body) =
|
||||||
"--circom-r1cs=tests/circuits/fixtures/proof_main.r1cs",
|
"--circom-r1cs=tests/circuits/fixtures/proof_main.r1cs",
|
||||||
"--circom-wasm=tests/circuits/fixtures/proof_main.wasm",
|
"--circom-wasm=tests/circuits/fixtures/proof_main.wasm",
|
||||||
"--circom-zkey=tests/circuits/fixtures/proof_main.zkey",
|
"--circom-zkey=tests/circuits/fixtures/proof_main.zkey",
|
||||||
"--eth-provider=http://localhost:8545",
|
|
||||||
"--eth-account=" & $account2
|
"--eth-account=" & $account2
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 11ccefd720f1932608b67db95af5b72d73d1257b
|
Subproject commit cc69f3a3ae7001baa2425e5cbb90f7b1b2cab05b
|
Loading…
Reference in New Issue