nim-codex/tests/tools/cirdl/testcirdl.nim
Mark Spanbroek ce6d5798a7
Use http subscriptions instead of websocket for tests
To work around this issue when subscriptions are
inactive for more than 5 minutes:
https://github.com/NomicFoundation/hardhat/issues/2053

Use 100 millisecond polling; default polling interval
of 4 seconds is too close to the 5 second timeout for
`check eventually`.
2024-11-13 10:22:01 +01:00

41 lines
947 B
Nim

import std/os
import std/osproc
import std/options
import pkg/chronos
import pkg/codex/contracts
import ../../asynctest
import ../../contracts/deployment
suite "tools/cirdl":
const
cirdl = "build" / "cirdl"
workdir = "."
test "circuit download tool":
let
circuitPath = "testcircuitpath"
rpcEndpoint = "http://localhost:8545"
marketplaceAddress = Marketplace.address
discard existsOrCreateDir(circuitPath)
let args = [circuitPath, rpcEndpoint, $marketplaceAddress]
let process = osproc.startProcess(
cirdl,
workdir,
args,
options={poParentStreams}
)
let returnCode = process.waitForExit()
check returnCode == 0
check:
fileExists(circuitPath/"proof_main_verification_key.json")
fileExists(circuitPath/"proof_main.r1cs")
fileExists(circuitPath/"proof_main.wasm")
fileExists(circuitPath/"proof_main.zkey")
removeDir(circuitPath)