feat: implement inner_nodes() iterator for PartialMmr

This commit is contained in:
Bobbin Threadbare
2023-12-19 02:38:31 -08:00
committed by Bobbin Threadbare
parent 8f92f44a55
commit 9baddfd138
6 changed files with 245 additions and 42 deletions

View File

@@ -191,11 +191,12 @@ pub struct RootPath {
pub path: MerklePath,
}
// SERILIZATION
// SERIALIZATION
// ================================================================================================
impl Serializable for MerklePath {
fn write_into<W: winter_utils::ByteWriter>(&self, target: &mut W) {
assert!(self.nodes.len() <= u8::MAX.into(), "Length enforced in the construtor");
assert!(self.nodes.len() <= u8::MAX.into(), "Length enforced in the constructor");
target.write_u8(self.nodes.len() as u8);
self.nodes.write_into(target);
}