mirror of
https://github.com/arnaucube/miden-crypto.git
synced 2026-01-12 00:51:29 +01:00
refactor: return MmrPeaks from PartialMmr::peaks()
This commit is contained in:
committed by
Bobbin Threadbare
parent
59d93cb8ba
commit
4d0d8d3058
@@ -88,9 +88,11 @@ impl PartialMmr {
|
||||
self.forest
|
||||
}
|
||||
|
||||
// Returns a reference to the current peaks in the [PartialMmr]
|
||||
pub fn peaks(&self) -> &[RpoDigest] {
|
||||
&self.peaks
|
||||
// Returns a reference to the current peaks in the [PartialMmr].
|
||||
pub fn peaks(&self) -> MmrPeaks {
|
||||
// expect() is OK here because the constructor ensures that MMR peaks can be constructed
|
||||
// correctly
|
||||
MmrPeaks::new(self.forest, self.peaks.clone()).expect("invalid MMR peaks")
|
||||
}
|
||||
|
||||
/// Given a leaf position, returns the Merkle path to its corresponding peak. If the position
|
||||
|
||||
Reference in New Issue
Block a user