Răsfoiți Sursa

change leaf to the coin for merkle tree in burn

narodnik 4 ani în urmă
părinte
comite
b0d3a92c62
1 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 2 1
      example/halo2/src/bin/burn.rs

+ 2 - 1
example/halo2/src/bin/burn.rs

@@ -540,7 +540,8 @@ fn main() {
     }
     }
 
 
     // Merkle root
     // Merkle root
-    let leaf = pallas::Base::random(&mut OsRng);
+    //let leaf = pallas::Base::random(&mut OsRng);
+    let leaf = coin.clone();
     let pos = rand::random::<u32>();
     let pos = rand::random::<u32>();
     let path: Vec<_> = (0..32).map(|_| pallas::Base::random(&mut OsRng)).collect();
     let path: Vec<_> = (0..32).map(|_| pallas::Base::random(&mut OsRng)).collect();
     let merkle_root = root(path.clone().try_into().unwrap(), pos, leaf);
     let merkle_root = root(path.clone().try_into().unwrap(), pos, leaf);