mirror of
https://github.com/codex-storage/codex-storage-proofs.git
synced 2025-03-04 04:10:34 +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"
|
exec "nbindgen --crate codex-storage-proofs --output codex_proofs_ffi.nim"
|
||||||
|
|
||||||
task tests, "run unit tests":
|
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 unittest2
|
||||||
import codex_storage_proofs
|
import codex_storage_proofs
|
||||||
|
|
||||||
suite "storage proofs ffi":
|
suite "storage proofs ffi":
|
||||||
test "basic ffi circuit":
|
test "basic ffi circuit":
|
||||||
var
|
var
|
||||||
r1cs_path = "src/circuit_tests/artifacts/storer-test.r1cs"
|
r1csPath = "src/circuit_tests/artifacts/storer-test.r1cs".absolutePath()
|
||||||
wasm_path = "src/circuit_tests/artifacts/storer-test_js/storer-test.wasm"
|
wasmPath = "src/circuit_tests/artifacts/storer-test_js/storer-test.wasm".absolutePath()
|
||||||
|
|
||||||
|
assert r1csPath.fileExists()
|
||||||
|
assert wasmPath.fileExists()
|
||||||
let
|
let
|
||||||
r1cs_buff = unsafeBufferPath(r1cs_path)
|
r1cs_buff = unsafeBufferPath(r1csPath)
|
||||||
wasm_buff = unsafeBufferPath(wasm_path)
|
wasm_buff = unsafeBufferPath(wasmPath)
|
||||||
|
|
||||||
let storage_ctx = init_storage_proofs(r1cs_buff, wasm_buff, nil)
|
let storage_ctx = init_storage_proofs(r1cs_buff, wasm_buff, nil)
|
||||||
|
|
||||||
@ -18,7 +21,7 @@ suite "storage proofs ffi":
|
|||||||
check storage_ctx != nil
|
check storage_ctx != nil
|
||||||
|
|
||||||
var
|
var
|
||||||
mpack_arg_path = "test/proof_test.mpack"
|
mpack_arg_path = "tests/proof_test.mpack"
|
||||||
proofBuff = unsafeBufferFromFile(mpack_arg_path)
|
proofBuff = unsafeBufferFromFile(mpack_arg_path)
|
||||||
echo "proofArgs:size: ", proofBuff.len()
|
echo "proofArgs:size: ", proofBuff.len()
|
||||||
let res = prove_mpack_ext(storage_ctx, addr proofBuff)
|
let res = prove_mpack_ext(storage_ctx, addr proofBuff)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user