in src/proof.rs [226:243]
fn serialize(&self) -> Vec<u8> {
// If the index list is empty, return empty vector.
if self.indexes.is_empty() {
return Vec::<u8>::new();
}
let mut bytes: Vec<u8> = Vec::new();
bytes.append(&mut usize_to_bytes(self.indexes.len(), BATCH_NUM_BYTE_NUM)); // Encode the batch_num.
bytes.append(&mut TreeIndex::serialize(&self.indexes)); // Encode the tree indexes.
bytes.append(&mut usize_to_bytes(
self.siblings.len(),
SIBLING_NUM_BYTE_NUM,
)); // Encode the sibling_num.
for item in &self.siblings {
bytes.append(&mut V::ProofNode::serialize(&item)); // Encode the siblings.
}
bytes
}