mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-26 11:06:00 +03:00
pass crh parameters into commitment merkle path verify method
This commit is contained in:
parent
cc3136193e
commit
8971821820
@ -55,12 +55,15 @@ pub fn verify_local_data_commitment(
|
||||
)?;
|
||||
|
||||
// Construct record commitment merkle path
|
||||
let mut local_data_merkle_path = CommitmentMerklePath::<LocalDataCommitment, LocalDataCRH>::read(&path[..])?;
|
||||
local_data_merkle_path.parameters = Some(system_parameters.local_data_crh.clone());
|
||||
let local_data_merkle_path = CommitmentMerklePath::<LocalDataCommitment, LocalDataCRH>::read(&path[..])?;
|
||||
|
||||
// Check record commitment merkle path is valid for the given local data commitment root
|
||||
let local_data_commitment_root = <LocalDataCRH as CRH>::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)
|
||||
}
|
||||
|
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user