From c404233d8aa54a98d5a299eaeb6dbca7be0d14ea Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Wed, 10 Jan 2024 16:30:18 +0200 Subject: [PATCH] fix stuffs --- build.nims | 2 +- tests/tffi.nim | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build.nims b/build.nims index f0a5785..dfaf027 100644 --- a/build.nims +++ b/build.nims @@ -4,4 +4,4 @@ task genffi, "update the nim ffi bindings": exec "nbindgen --crate codex-storage-proofs --output codex_proofs_ffi.nim" task tests, "run unit tests": - exec "testament pattern \"tests/t*.nim\" " + exec "nim c -r tests/tffi.nim" diff --git a/tests/tffi.nim b/tests/tffi.nim index 3ff7e74..43a2c30 100644 --- a/tests/tffi.nim +++ b/tests/tffi.nim @@ -1,16 +1,19 @@ +import std/os import unittest2 import codex_storage_proofs suite "storage proofs ffi": test "basic ffi circuit": var - r1cs_path = "src/circuit_tests/artifacts/storer-test.r1cs" - wasm_path = "src/circuit_tests/artifacts/storer-test_js/storer-test.wasm" + r1csPath = "src/circuit_tests/artifacts/storer-test.r1cs".absolutePath() + wasmPath = "src/circuit_tests/artifacts/storer-test_js/storer-test.wasm".absolutePath() + assert r1csPath.fileExists() + assert wasmPath.fileExists() let - r1cs_buff = unsafeBufferPath(r1cs_path) - wasm_buff = unsafeBufferPath(wasm_path) + r1cs_buff = unsafeBufferPath(r1csPath) + wasm_buff = unsafeBufferPath(wasmPath) let storage_ctx = init_storage_proofs(r1cs_buff, wasm_buff, nil) @@ -18,7 +21,7 @@ suite "storage proofs ffi": check storage_ctx != nil var - mpack_arg_path = "test/proof_test.mpack" + mpack_arg_path = "tests/proof_test.mpack" proofBuff = unsafeBufferFromFile(mpack_arg_path) echo "proofArgs:size: ", proofBuff.len() let res = prove_mpack_ext(storage_ctx, addr proofBuff)