mirror of
https://github.com/logos-storage/logos-storage-proofs.git
synced 2026-01-03 22:13:11 +00:00
use rando data for chunks
This commit is contained in:
parent
c6a09293e7
commit
389c0bb050
@ -129,9 +129,6 @@ mod test {
|
|||||||
parent_hash_l,
|
parent_hash_l,
|
||||||
];
|
];
|
||||||
|
|
||||||
println!("hashes: {:?}", hashes);
|
|
||||||
println!("siblings: {:?}", siblings);
|
|
||||||
|
|
||||||
let root = merkelize(hashes.as_slice());
|
let root = merkelize(hashes.as_slice());
|
||||||
let proof_bytes = &mut Vec::new();
|
let proof_bytes = &mut Vec::new();
|
||||||
let public_inputs_bytes = &mut Vec::new();
|
let public_inputs_bytes = &mut Vec::new();
|
||||||
|
|||||||
10
src/ffi.rs
10
src/ffi.rs
@ -175,6 +175,7 @@ pub extern "C" fn free_proof_ctx(ctx: *mut ProofCtx) {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use ark_std::rand::{rngs::ThreadRng, distributions::Alphanumeric, Rng};
|
||||||
use ruint::aliases::U256;
|
use ruint::aliases::U256;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -190,7 +191,12 @@ mod tests {
|
|||||||
// and hash is the hash of each vector generated using the digest function
|
// and hash is the hash of each vector generated using the digest function
|
||||||
let data = (0..4)
|
let data = (0..4)
|
||||||
.map(|_| {
|
.map(|_| {
|
||||||
let preimages: Vec<U256> = (0..4).map(|_| U256::from(1)).collect();
|
let rng = ThreadRng::default();
|
||||||
|
let preimages: Vec<U256> = rng
|
||||||
|
.sample_iter(Alphanumeric)
|
||||||
|
.take(256)
|
||||||
|
.map(|c| U256::from(c))
|
||||||
|
.collect();
|
||||||
let hash = digest(&preimages, Some(16));
|
let hash = digest(&preimages, Some(16));
|
||||||
(preimages, hash)
|
(preimages, hash)
|
||||||
})
|
})
|
||||||
@ -216,7 +222,7 @@ mod tests {
|
|||||||
let sibling_hashes = &[
|
let sibling_hashes = &[
|
||||||
hashes[1],
|
hashes[1],
|
||||||
parent_hash_r,
|
parent_hash_r,
|
||||||
hashes[1],
|
hashes[0],
|
||||||
parent_hash_r,
|
parent_hash_r,
|
||||||
hashes[3],
|
hashes[3],
|
||||||
parent_hash_l,
|
parent_hash_l,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user