[bug] correct hash construction

This commit is contained in:
Sosthene 2024-12-03 22:34:36 +01:00
parent e47059668d
commit a2b969b72e
2 changed files with 4 additions and 4 deletions

View File

@ -395,8 +395,8 @@ impl ValidationRule {
let mut yes_votes: Vec<Proof> = Vec::new();
let mut no_votes: Vec<Proof> = Vec::new();
let yes = AnkHash::ValidationYes(AnkValidationYesHash::from_byte_array(merkle_root));
let no = AnkHash::ValidationNo(AnkValidationNoHash::from_byte_array(merkle_root));
let yes = AnkHash::ValidationYes(AnkValidationYesHash::from_merkle_root(merkle_root));
let no = AnkHash::ValidationNo(AnkValidationNoHash::from_merkle_root(merkle_root));
// Validate proofs here
for proof in proofs {

View File

@ -36,9 +36,9 @@ impl ProcessState {
pub fn get_message_hash(&self, approval: bool) -> anyhow::Result<AnkHash> {
let merkle_root = <Value as Pcd>::create_merkle_tree(&self.pcd_commitment)?.root().unwrap();
if approval {
Ok(AnkHash::ValidationYes(AnkValidationYesHash::from_byte_array(merkle_root)))
Ok(AnkHash::ValidationYes(AnkValidationYesHash::from_merkle_root(merkle_root)))
} else {
Ok(AnkHash::ValidationNo(AnkValidationNoHash::from_byte_array(merkle_root)))
Ok(AnkHash::ValidationNo(AnkValidationNoHash::from_merkle_root(merkle_root)))
}
}