Browse Source

miscellaneous changes

mohab 4 years ago
parent
commit
8b9bdac46f
3 changed files with 5 additions and 4 deletions
  1. 2 1
      example/lead.rs
  2. 1 1
      src/crypto/lead_proof.rs
  3. 2 2
      src/zk/circuit/lead_contract.rs

+ 2 - 1
example/lead.rs

@@ -70,7 +70,8 @@ fn create_coins_sks(len : usize) ->
         //let (leaf_pos, path) = tree.authentication_path(leaf_position.unwrap()).unwrap();
         let path = tree.authentication_path(leaf_position.unwrap()).unwrap();
         //note root sk is at tree.root()
-        root_sks.push(node);
+        //root_sks.push(node);
+        root_sks.push(tree.root());
         path_sks.push(path.as_slice().try_into().unwrap());
     }
     (root_sks, path_sks)

+ 1 - 1
src/crypto/lead_proof.rs

@@ -59,7 +59,7 @@ pub fn create_lead_proof(
     let public_inputs = coin.public_inputs();
     let proof = Proof::create(&pk, &[contract], &public_inputs, &mut OsRng)?;
     debug!("Prove lead: [{:?}]", start.elapsed());
-    Ok((proof))
+    Ok(proof)
 }
 
 pub fn verify_lead_proof(

+ 2 - 2
src/zk/circuit/lead_contract.rs

@@ -599,8 +599,8 @@ impl Circuit<pallas::Base> for LeadContract {
         )?;
 
         let node = MerkleNode::from_bytes(&self.root_sk.unwrap().to_repr()).unwrap();
-        let serialized = serde_json::to_string(&node).unwrap();
-        println!("serialized: {}", serialized);
+        //let serialized = serde_json::to_string(&node).unwrap();
+        //println!("root_sk: {}", serialized);
 
         //TODO (research) this multiplication panics!
         let y_commit_exp = ar_chip.mul(