fix(miniprotocols): Decode BlockContent correctly (#60)

This commit is contained in:
Santiago Carmuega 2022-02-26 17:14:48 -03:00 committed by GitHub
parent 80dace2600
commit f86b2250b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -166,7 +166,8 @@ impl EncodePayload for HeaderContent {
impl DecodePayload for BlockContent {
fn decode_payload(d: &mut crate::PayloadDecoder) -> Result<Self, Box<dyn std::error::Error>> {
d.tag()?;
Ok(BlockContent(d.decode()?))
let bytes = d.bytes()?;
Ok(BlockContent(Vec::from(bytes)))
}
}