SubtreeLeaf::from_smt_leaf() was only used in tests
This commit is contained in:
parent
aa3197fcc1
commit
a14e67bf2a
1 changed files with 8 additions and 11 deletions
|
@ -627,16 +627,6 @@ pub struct SubtreeLeaf {
|
|||
pub hash: RpoDigest,
|
||||
}
|
||||
|
||||
impl SubtreeLeaf {
|
||||
#[cfg_attr(not(test), allow(dead_code))]
|
||||
fn from_smt_leaf(leaf: &crate::merkle::SmtLeaf) -> Self {
|
||||
Self {
|
||||
col: leaf.index().index.value(),
|
||||
hash: leaf.hash(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Helper struct to organize the return value of [`SparseMerkleTree::sorted_pairs_to_leaves()`].
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub(crate) struct PairComputations<K, L> {
|
||||
|
@ -779,6 +769,13 @@ mod test {
|
|||
Felt, Word, ONE,
|
||||
};
|
||||
|
||||
fn smtleaf_to_subtree_leaf(leaf: &SmtLeaf) -> SubtreeLeaf {
|
||||
SubtreeLeaf {
|
||||
col: leaf.index().index.value(),
|
||||
hash: leaf.hash(),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_sorted_pairs_to_leaves() {
|
||||
let entries: Vec<(RpoDigest, Word)> = vec![
|
||||
|
@ -827,7 +824,7 @@ mod test {
|
|||
// Subtree 2.
|
||||
vec![next_leaf()],
|
||||
]
|
||||
.map(|subtree| subtree.into_iter().map(SubtreeLeaf::from_smt_leaf).collect())
|
||||
.map(|subtree| subtree.into_iter().map(smtleaf_to_subtree_leaf).collect())
|
||||
.to_vec();
|
||||
assert_eq!(control_leaves_iter.next(), None);
|
||||
control_subtree_leaves
|
||||
|
|
Loading…
Add table
Reference in a new issue