Remove ExactSizeIterator constraint from SimpleSmt::with_leaves() (#228)

* Change InvalidNumEntries error

* max computation

* remove length check

* remove ExactSizeIterator constraint

* fix InvalidNumEntries error condition

* 2_usize
This commit is contained in:
Philippe Laferrière
2023-11-28 15:34:20 -05:00
committed by Bobbin Threadbare
parent fa475d1929
commit d719cc2663
3 changed files with 29 additions and 31 deletions

View File

@@ -109,9 +109,9 @@ impl PartialMerkleTree {
// check if the number of leaves can be accommodated by the tree's depth; we use a min
// depth of 63 because we consider passing in a vector of size 2^64 infeasible.
let max = (1_u64 << 63) as usize;
let max = 2usize.pow(63);
if layers.len() > max {
return Err(MerkleError::InvalidNumEntries(max, layers.len()));
return Err(MerkleError::InvalidNumEntries(max));
}
// Get maximum depth