diff --git a/plonky2x/src/frontend/merkle/tendermint.rs b/plonky2x/src/frontend/merkle/tendermint.rs index 489b762fa..4f99fa68e 100644 --- a/plonky2x/src/frontend/merkle/tendermint.rs +++ b/plonky2x/src/frontend/merkle/tendermint.rs @@ -151,11 +151,14 @@ impl, const D: usize> CircuitBuilder { pub fn compute_root_from_leaves( &mut self, - leaves: ArrayVariable, NB_LEAVES>, - leaves_enabled: ArrayVariable, + leaves: Vec>, + leaves_enabled: Vec, ) -> Bytes32Variable { - let hashed_leaves = self.hash_leaves::(leaves.as_vec()); - self.get_root_from_hashed_leaves::(hashed_leaves, leaves_enabled.as_vec()) + assert!(NB_LEAVES == leaves.len()); + assert!(NB_LEAVES == leaves_enabled.len()); + + let hashed_leaves = self.hash_leaves::(leaves.to_vec()); + self.get_root_from_hashed_leaves::(hashed_leaves, leaves_enabled.to_vec()) } }