[bug] correct hash construction
This commit is contained in:
parent
e47059668d
commit
a2b969b72e
@ -395,8 +395,8 @@ impl ValidationRule {
|
|||||||
let mut yes_votes: Vec<Proof> = Vec::new();
|
let mut yes_votes: Vec<Proof> = Vec::new();
|
||||||
let mut no_votes: Vec<Proof> = Vec::new();
|
let mut no_votes: Vec<Proof> = Vec::new();
|
||||||
|
|
||||||
let yes = AnkHash::ValidationYes(AnkValidationYesHash::from_byte_array(merkle_root));
|
let yes = AnkHash::ValidationYes(AnkValidationYesHash::from_merkle_root(merkle_root));
|
||||||
let no = AnkHash::ValidationNo(AnkValidationNoHash::from_byte_array(merkle_root));
|
let no = AnkHash::ValidationNo(AnkValidationNoHash::from_merkle_root(merkle_root));
|
||||||
|
|
||||||
// Validate proofs here
|
// Validate proofs here
|
||||||
for proof in proofs {
|
for proof in proofs {
|
||||||
|
@ -36,9 +36,9 @@ impl ProcessState {
|
|||||||
pub fn get_message_hash(&self, approval: bool) -> anyhow::Result<AnkHash> {
|
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();
|
let merkle_root = <Value as Pcd>::create_merkle_tree(&self.pcd_commitment)?.root().unwrap();
|
||||||
if approval {
|
if approval {
|
||||||
Ok(AnkHash::ValidationYes(AnkValidationYesHash::from_byte_array(merkle_root)))
|
Ok(AnkHash::ValidationYes(AnkValidationYesHash::from_merkle_root(merkle_root)))
|
||||||
} else {
|
} else {
|
||||||
Ok(AnkHash::ValidationNo(AnkValidationNoHash::from_byte_array(merkle_root)))
|
Ok(AnkHash::ValidationNo(AnkValidationNoHash::from_merkle_root(merkle_root)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user