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

fix: empty input in transaction rlp decoding #2656

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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