refactor: update repo to be compatible with Winterfell 0.8 (#275)

This commit is contained in:
Andrey Khmuro
2024-02-14 21:30:35 +02:00
committed by Bobbin Threadbare
parent 552d90429b
commit cd4525c7ad
15 changed files with 49 additions and 56 deletions

View File

@@ -206,14 +206,14 @@ 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 constructor");
target.write_u8(self.nodes.len() as u8);
self.nodes.write_into(target);
target.write_many(&self.nodes);
}
}
impl Deserializable for MerklePath {
fn read_from<R: ByteReader>(source: &mut R) -> Result<Self, DeserializationError> {
let count = source.read_u8()?.into();
let nodes = RpoDigest::read_batch_from(source, count)?;
let nodes = source.read_many::<RpoDigest>(count)?;
Ok(Self { nodes })
}
}