Explorar el Código

fix broken smt tests

zero hace 2 años
padre
commit
db67d3bdf0
Se han modificado 2 ficheros con 4 adiciones y 4 borrados
  1. 2 2
      src/zk/gadget/smt.rs
  2. 2 2
      tests/smt.rs

+ 2 - 2
src/zk/gadget/smt.rs

@@ -322,12 +322,12 @@ mod tests {
     fn test_smt_circuit() {
         let hasher = Poseidon::<Fp, 2>::hasher();
         let leaves: [Fp; HEIGHT] = [(); HEIGHT].map(|_| Fp::random(&mut OsRng));
-        let empty_leaf = [0u8; 64];
+        let empty_leaf = [0u8; 32];
 
         let smt = SparseMerkleTree::<Fp, Poseidon<Fp, 2>, HEIGHT>::new_sequential(
             &leaves,
             &hasher.clone(),
-            &empty_leaf,
+            empty_leaf,
         )
         .unwrap();
 

+ 2 - 2
tests/smt.rs

@@ -40,13 +40,13 @@ fn zkvm_smt() -> Result<()> {
     let zkbin = ZkBinary::decode(bincode)?;
 
     let poseidon = Poseidon::<Fp, 2>::new();
-    let empty_leaf = [0u8; 64];
+    let empty_leaf = [0u8; 32];
     let leaves = [Fp::random(&mut OsRng), Fp::random(&mut OsRng), Fp::random(&mut OsRng)];
 
     let smt = SparseMerkleTree::<Fp, Poseidon<Fp, 2>, SPARSE_MERKLE_DEPTH>::new_sequential(
         &leaves,
         &poseidon.clone(),
-        &empty_leaf,
+        empty_leaf,
     )
     .unwrap();