mirror of
https://github.com/logos-storage/logos-storage-proofs.git
synced 2026-01-04 06:23:11 +00:00
wip: ffi
This commit is contained in:
parent
1b5b249f59
commit
ea4a2a082e
46
src/ffi.rs
46
src/ffi.rs
@ -1,30 +1,30 @@
|
|||||||
// use crate::storageproofs::StorageProofs;
|
use crate::storageproofs::StorageProofs;
|
||||||
// use std::str;
|
use std::str;
|
||||||
|
|
||||||
// #[no_mangle]
|
#[no_mangle]
|
||||||
// pub extern "C" fn init(
|
pub extern "C" fn init(
|
||||||
// r1cs: *const u8,
|
r1cs: *const u8,
|
||||||
// r1cs_len: usize,
|
r1cs_len: usize,
|
||||||
// wasm: *const u8,
|
wasm: *const u8,
|
||||||
// wasm_len: usize,
|
wasm_len: usize,
|
||||||
// ) -> *mut StorageProofs {
|
) -> *mut StorageProofs {
|
||||||
// let r1cs = unsafe {
|
let r1cs = unsafe {
|
||||||
// let slice = std::slice::from_raw_parts(r1cs, r1cs_len);
|
let slice = std::slice::from_raw_parts(r1cs, r1cs_len);
|
||||||
// str::from_utf8(slice).unwrap()
|
str::from_utf8(slice).unwrap()
|
||||||
// };
|
};
|
||||||
|
|
||||||
// let wasm = unsafe {
|
let wasm = unsafe {
|
||||||
// let slice = std::slice::from_raw_parts(wasm, wasm_len);
|
let slice = std::slice::from_raw_parts(wasm, wasm_len);
|
||||||
// str::from_utf8(slice).unwrap()
|
str::from_utf8(slice).unwrap()
|
||||||
// };
|
};
|
||||||
|
|
||||||
// let storage_proofs = Box::into_raw(Box::new(StorageProofs::new(
|
let storage_proofs = Box::into_raw(Box::new(StorageProofs::new(
|
||||||
// wasm.to_string(),
|
wasm.to_string(),
|
||||||
// r1cs.to_string(),
|
r1cs.to_string(),
|
||||||
// )));
|
)));
|
||||||
|
|
||||||
// return storage_proofs;
|
return storage_proofs;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// #[cfg(test)]
|
// #[cfg(test)]
|
||||||
// mod tests {
|
// mod tests {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user