nim-dagger/tests/tools/cirdl/testcirdl.nim
Adam Uhlíř e5df8c50d3
style: nph formatting (#1067)
* style: nph setup

* chore: formates codex/ and tests/ folder with nph 0.6.1
2025-01-21 20:54:46 +00:00

36 lines
927 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://127.0.0.1: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)