Skip to content

Commit

Permalink
used ?
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentash committed Oct 13, 2023
1 parent ef00dd1 commit 7c69d8c
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions crates/utils/src/rlp.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,8 @@ fn rlp_decode(input: Span<u8>) -> Result<(RLPItem, usize), RLPError> {
}

let mut list_input = input.slice(1, len);
let res = rlp_decode_list(ref list_input);
if res.is_err() {
return Result::Err(res.unwrap_err());
}
Result::Ok((RLPItem::List(res.unwrap()), 1 + len))
let res = rlp_decode_list(ref list_input)?;
Result::Ok((RLPItem::List(res), 1 + len))
},
RLPType::ListLong => {
// Extract the amount of bytes representing the data payload length
Expand All @@ -117,11 +114,8 @@ fn rlp_decode(input: Span<u8>) -> Result<(RLPItem, usize), RLPError> {
}

let mut list_input = input.slice(1 + len_of_len, len);
let res = rlp_decode_list(ref list_input);
if res.is_err() {
return Result::Err(res.unwrap_err());
}
Result::Ok((RLPItem::List(res.unwrap()), 1 + len_of_len + len))
let res = rlp_decode_list(ref list_input)?;
Result::Ok((RLPItem::List(res), 1 + len_of_len + len))
}
}
}
Expand Down

0 comments on commit 7c69d8c

Please sign in to comment.