Arnaud f7d06cd0e8
chore(marketplace): switch to websocket (#1166)
* Switch to websocket

* Create resubscribe future

* Resubscribe websocket events after 5 minutes

* Remove the subscribe workaround and use define the resubscribe symbol

* Use localhost for ws url

* Define 240 seconds for resubscription interval

* Ensute that updates are sync when using ws
2025-05-23 14:13:19 +00:00

36 lines
925 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 = "ws://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)