2024-01-10 16:46:26 +02:00
|
|
|
import std/os
|
2023-12-22 19:03:43 -07:00
|
|
|
|
|
|
|
|
task genffi, "update the nim ffi bindings":
|
2024-01-10 12:51:45 +02:00
|
|
|
exec "cargo install nbindgen"
|
|
|
|
|
exec "nbindgen --crate codex-storage-proofs --output codex_proofs_ffi.nim"
|
|
|
|
|
|
2024-01-10 16:40:09 +02:00
|
|
|
task compileCircuits, "compile test circuits":
|
2024-01-10 16:42:40 +02:00
|
|
|
exec "npm i"
|
2024-01-10 16:40:09 +02:00
|
|
|
exec "circom src/circuit_tests/poseidon-digest-test.circom --r1cs --wasm -o src/circuit_tests/artifacts"
|
|
|
|
|
exec "circom src/circuit_tests/poseidon-hash-test.circom --r1cs --wasm -o src/circuit_tests/artifacts"
|
|
|
|
|
exec "circom src/circuit_tests/storer-test.circom --r1cs --wasm -o src/circuit_tests/artifacts"
|
|
|
|
|
|
2024-01-10 12:56:32 +02:00
|
|
|
task tests, "run unit tests":
|
2024-01-10 16:46:26 +02:00
|
|
|
let storerR1cs = fileExists "src/circuit_tests/artifacts/storer-test.r1cs"
|
|
|
|
|
let storerWasm = fileExists "src/circuit_tests/artifacts/storer-test_js/storer-test.wasm"
|
|
|
|
|
if not storerR1cs or not storerWasm:
|
|
|
|
|
compileCircuitsTask()
|
2024-01-10 16:30:18 +02:00
|
|
|
exec "nim c -r tests/tffi.nim"
|