store: added with_merkle_paths constructor

And unit tests for each constructor type.
This commit is contained in:
Augusto F. Hack
2023-03-22 14:17:09 +01:00
parent 482dab94c5
commit b250752883
2 changed files with 65 additions and 0 deletions

View File

@@ -84,6 +84,15 @@ impl MerkleStore {
Ok(self)
}
/// Appends the provided merkle path set.
pub fn with_merkle_paths<I>(mut self, paths: I) -> Result<Self, MerkleError>
where
I: IntoIterator<Item = (u64, Word, MerklePath)>,
{
self.add_merkle_paths(paths)?;
Ok(self)
}
// PUBLIC ACCESSORS
// --------------------------------------------------------------------------------------------