Skip to content

Commit

Permalink
solve errors from main merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jotabulacios committed Jun 6, 2024
1 parent 7b5eff8 commit 793538c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions operator/merkle_tree/lib/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use lambdaworks_crypto::merkle_tree::merkle::MerkleTree;
use batcher::types::{VerificationCommitmentBatch, VerificationData};
use batcher::types::{VerificationCommitmentBatch, VerificationData,VerificationDataCommitment};
use hex;
use serde_json;

Expand All @@ -13,9 +13,9 @@ pub extern "C" fn verify_batch_merkle_root_ffi(
) -> bool {
match serde_json::from_slice::<Vec<VerificationData>>(&batch_bytes[..batch_len as usize]) {
Ok(batch) => {
let batch_commitment = VerificationCommitmentBatch::from(&batch);
let batch_merkle_tree: MerkleTree<VerificationCommitmentBatch> = MerkleTree::build(&batch_commitment.0);
let batch_merkle_root = hex::encode(batch_merkle_tree.root);
let commitments_batch:Vec<VerificationDataCommitment> = batch.into_iter().map(|verification_data| verification_data.into()).collect();
let batch_merkle_tree: MerkleTree<VerificationCommitmentBatch> = MerkleTree::build(&commitments_batch);
let batch_merkle_root = hex::encode(batch_merkle_tree.root);
let received_merkle_root = hex::encode(merkle_root);
batch_merkle_root == received_merkle_root
},
Expand Down

0 comments on commit 793538c

Please sign in to comment.