diff --git a/src/accumulator/mem_forest.rs b/src/accumulator/mem_forest.rs index ff324fa..b777291 100644 --- a/src/accumulator/mem_forest.rs +++ b/src/accumulator/mem_forest.rs @@ -255,7 +255,7 @@ impl MemForest { /// ``` pub fn serialize(&self, mut writer: W) -> std::io::Result<()> { writer.write_all(&self.leaves.to_le_bytes())?; - writer.write_all(&self.roots.len().to_le_bytes())?; + writer.write_all(&(self.roots.len() as u64).to_le_bytes())?; for root in &self.roots { root.write_one(&mut writer).unwrap(); diff --git a/src/accumulator/proof.rs b/src/accumulator/proof.rs index 498dfd1..4c6049e 100644 --- a/src/accumulator/proof.rs +++ b/src/accumulator/proof.rs @@ -370,12 +370,12 @@ impl Proof { /// ``` pub fn serialize(&self, mut writer: W) -> std::io::Result { let mut len = 16; - writer.write_all(&self.targets.len().to_le_bytes())?; + writer.write_all(&(self.targets.len() as u64).to_le_bytes())?; for target in &self.targets { len += 8; writer.write_all(&target.to_le_bytes())?; } - writer.write_all(&self.hashes.len().to_le_bytes())?; + writer.write_all(&(self.hashes.len() as u64).to_le_bytes())?; for hash in &self.hashes { len += 32; hash.write(&mut writer)?; diff --git a/src/accumulator/stump.rs b/src/accumulator/stump.rs index 631739c..2225e66 100644 --- a/src/accumulator/stump.rs +++ b/src/accumulator/stump.rs @@ -107,7 +107,7 @@ impl Stump { pub fn serialize(&self, mut writer: &mut Dst) -> std::io::Result { let mut len = 8; writer.write_all(&self.leaves.to_le_bytes())?; - writer.write_all(&self.roots.len().to_le_bytes())?; + writer.write_all(&(self.roots.len() as u64).to_le_bytes())?; for root in self.roots.iter() { len += 32; root.write(&mut writer)?;