Update comm and crh traits

This commit is contained in:
howardwu 2021-03-04 10:35:10 -08:00
parent 4f50b44a63
commit 05c6f43018
3 changed files with 10 additions and 12 deletions

View File

@ -21,12 +21,12 @@ use crate::StateValues;
use leo_ast::Input as AstInput;
use snarkvm_algorithms::commitment_tree::CommitmentMerklePath;
use snarkvm_algorithms::traits::CommitmentScheme;
use snarkvm_algorithms::traits::CRH;
use snarkvm_dpc::base_dpc::instantiated::Components;
use snarkvm_dpc::base_dpc::instantiated::LocalDataCRH;
use snarkvm_dpc::base_dpc::instantiated::LocalDataCommitment;
use snarkvm_dpc::base_dpc::parameters::SystemParameters;
use snarkvm_models::algorithms::CommitmentScheme;
use snarkvm_models::algorithms::CRH;
use snarkvm_models::dpc::DPCComponents;
use snarkvm_utilities::bytes::ToBytes;
use snarkvm_utilities::to_bytes;

View File

@ -18,10 +18,10 @@ use crate::DPCRecordValues;
use crate::RecordVerificationError;
use leo_ast::Record as AstRecord;
use snarkvm_algorithms::traits::CommitmentScheme;
use snarkvm_dpc::base_dpc::instantiated::Components;
use snarkvm_dpc::base_dpc::instantiated::RecordCommitment;
use snarkvm_dpc::base_dpc::parameters::SystemParameters;
use snarkvm_models::algorithms::CommitmentScheme;
use snarkvm_utilities::bytes::ToBytes;
use snarkvm_utilities::to_bytes;
use snarkvm_utilities::FromBytes;

View File

@ -18,11 +18,11 @@ use leo_ast::Input;
use leo_input::LeoInputParser;
use leo_state::verify_local_data_commitment;
use snarkvm_algorithms::traits::CommitmentScheme;
use snarkvm_algorithms::traits::CRH;
use snarkvm_dpc::base_dpc::instantiated::*;
use snarkvm_dpc::base_dpc::record_payload::RecordPayload;
use snarkvm_dpc::base_dpc::DPC;
use snarkvm_models::algorithms::CommitmentScheme;
use snarkvm_models::algorithms::CRH;
use snarkvm_models::dpc::Record;
use snarkvm_models::objects::AccountScheme;
use snarkvm_objects::Account;
@ -74,13 +74,11 @@ fn test_generate_values_from_dpc() {
let noop_program_snark_pp =
InstantiatedDPC::generate_noop_program_snark_parameters(&system_parameters, &mut rng).unwrap();
let noop_program_id = to_bytes![
ProgramVerificationKeyCRH::hash(
&system_parameters.program_verification_key_crh,
&to_bytes![noop_program_snark_pp.verification_key].unwrap()
)
.unwrap()
]
let noop_program_id = to_bytes![ProgramVerificationKeyCRH::hash(
&system_parameters.program_verification_key_crh,
&to_bytes![noop_program_snark_pp.verification_key].unwrap()
)
.unwrap()]
.unwrap();
let signature_parameters = &system_parameters.account_signature;