arc-malachitebft-engine 0.7.0-pre

Implementation of the Malachite BFT consensus engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::util::streaming::StreamId;

impl borsh::BorshSerialize for StreamId {
    fn serialize<W: borsh::io::Write>(&self, writer: &mut W) -> borsh::io::Result<()> {
        self.0.to_vec().serialize(writer)
    }
}

impl borsh::BorshDeserialize for StreamId {
    fn deserialize_reader<R: borsh::io::Read>(reader: &mut R) -> borsh::io::Result<Self> {
        let bytes = Vec::<u8>::deserialize_reader(reader)?;
        Ok(StreamId(bytes.into()))
    }
}