mirror of
https://github.com/codex-storage/codex-storage-proofs.git
synced 2025-03-03 20:00:49 +00:00
fix stuffs
This commit is contained in:
parent
40525d484f
commit
c404233d8a
@ -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"
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user