diff --git a/state/src/local_data_commitment/local_data_commitment.rs b/state/src/local_data_commitment/local_data_commitment.rs index 7254050bfa..53a84b8149 100644 --- a/state/src/local_data_commitment/local_data_commitment.rs +++ b/state/src/local_data_commitment/local_data_commitment.rs @@ -55,12 +55,15 @@ pub fn verify_local_data_commitment( )?; // Construct record commitment merkle path - let mut local_data_merkle_path = CommitmentMerklePath::::read(&path[..])?; - local_data_merkle_path.parameters = Some(system_parameters.local_data_crh.clone()); + let local_data_merkle_path = CommitmentMerklePath::::read(&path[..])?; // Check record commitment merkle path is valid for the given local data commitment root let local_data_commitment_root = ::Output::read(&root[..])?; - let result = local_data_merkle_path.verify(&local_data_commitment_root, &local_data_commitment_leaf)?; + let result = local_data_merkle_path.verify( + &system_parameters.local_data_crh, + &local_data_commitment_root, + &local_data_commitment_leaf, + )?; Ok(result) } diff --git a/state/tests/test_verify_local_data_commitment.rs b/state/tests/test_verify_local_data_commitment.rs index 56b3da4a6c..24e9de213c 100644 --- a/state/tests/test_verify_local_data_commitment.rs +++ b/state/tests/test_verify_local_data_commitment.rs @@ -133,6 +133,7 @@ fn test_generate_values_from_dpc() { &mut rng, ) .unwrap(); + let local_data = context.into_local_data(); let leaf_index = 0; let record = &local_data.old_records[leaf_index];