Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
fix: empty input in transaction rlp decoding (#2656)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrasiuk authored Oct 31, 2023
1 parent efdc8d4 commit 49af6e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ethers-core/src/types/transaction/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ impl Decodable for Transaction {
txn.chain_id = extract_chain_id(sig.v).map(|id| id.as_u64().into());
} else {
// if it is not enveloped then we need to use rlp.as_raw instead of rlp.data
let first_byte = rlp.as_raw()[0];
let first_byte = *rlp.as_raw().first().ok_or(DecoderError::Custom("empty slice"))?;
let (first, data) = if first_byte <= 0x7f {
(first_byte, rlp.as_raw())
} else {
Expand Down

0 comments on commit 49af6e4

Please sign in to comment.