mirror of
https://github.com/logos-storage/logos-storage-proofs.git
synced 2026-01-02 13:33:10 +00:00
update ffi
This commit is contained in:
parent
aa7750bc4b
commit
2ba2c31072
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,3 +16,4 @@ test/circuits/artifacts
|
||||
out.log
|
||||
src/circuit_tests/artifacts/*
|
||||
!src/circuit_tests/artifacts/.keep
|
||||
codex_storage_proofs
|
||||
|
||||
@ -21,8 +21,22 @@ static:
|
||||
|
||||
{.passl: "-lcodex_storage_proofs" & " -L" & libDir.}
|
||||
|
||||
import codex_proofs_ffi
|
||||
export codex_proofs_ffi
|
||||
include codex_proofs_ffi
|
||||
|
||||
proc unsafeBufferPath*(path: var string): Buffer =
|
||||
assert path.len() > 0
|
||||
Buffer(data: cast[ptr uint8](path.cstring), len: path.len().uint)
|
||||
|
||||
when isMainModule:
|
||||
init_proof_ctx()
|
||||
var
|
||||
r1cs_path = "src/circuit_tests/artifacts/storer-test.r1cs"
|
||||
wasm_path = "src/circuit_tests/artifacts/storer-test_js/storer-test.wasm"
|
||||
let
|
||||
r1cs_buff = unsafeBufferPath(r1cs_path)
|
||||
wasm_buff = unsafeBufferPath(wasm_path)
|
||||
|
||||
let storage_ctx = init_storage_proofs(r1cs_buff, wasm_buff, nil)
|
||||
|
||||
echo "storage_ctx: ", storage_ctx.repr
|
||||
assert storage_ctx != nil
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user