Skip to content

Commit

Permalink
change back to vec
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani committed Sep 18, 2023
1 parent d43d33e commit d768589
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions plonky2x/src/frontend/merkle/tendermint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,14 @@ impl<L: PlonkParameters<D>, const D: usize> CircuitBuilder<L, D> {

pub fn compute_root_from_leaves<const NB_LEAVES: usize, const LEAF_SIZE_BYTES: usize>(
&mut self,
leaves: ArrayVariable<BytesVariable<LEAF_SIZE_BYTES>, NB_LEAVES>,
leaves_enabled: ArrayVariable<BoolVariable, NB_LEAVES>,
leaves: Vec<BytesVariable<LEAF_SIZE_BYTES>>,
leaves_enabled: Vec<BoolVariable>,
) -> Bytes32Variable {
let hashed_leaves = self.hash_leaves::<LEAF_SIZE_BYTES>(leaves.as_vec());
self.get_root_from_hashed_leaves::<NB_LEAVES>(hashed_leaves, leaves_enabled.as_vec())
assert!(NB_LEAVES == leaves.len());
assert!(NB_LEAVES == leaves_enabled.len());

let hashed_leaves = self.hash_leaves::<LEAF_SIZE_BYTES>(leaves.to_vec());
self.get_root_from_hashed_leaves::<NB_LEAVES>(hashed_leaves, leaves_enabled.to_vec())
}
}

Expand Down

0 comments on commit d768589

Please sign in to comment.