Skip to content

Commit

Permalink
no decode_bytes for fastrlp header
Browse files Browse the repository at this point in the history
  • Loading branch information
Rjected committed Oct 30, 2023
1 parent 0b6d46e commit fca1d73
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/support/fastrlp.rs
Expand Up @@ -76,7 +76,14 @@ impl<const BITS: usize, const LIMBS: usize> Encodable for Uint<BITS, LIMBS> {
impl<const BITS: usize, const LIMBS: usize> Decodable for Uint<BITS, LIMBS> {
#[inline]
fn decode(buf: &mut &[u8]) -> Result<Self, DecodeError> {
let bytes = Header::decode_bytes(buf, false)?;
// let bytes = Header::decode_bytes(buf, false)?;
let header = Header::decode(buf)?;
if header.list {
return Err(DecodeError::UnexpectedList);
}

let bytes = &buf[..header.payload_length];
*buf = &buf[header.payload_length..];

// The RLP spec states that deserialized positive integers with leading zeroes
// get treated as invalid.
Expand Down

0 comments on commit fca1d73

Please sign in to comment.