Boilertalk / Web3.swift

A pure swift Ethereum Web3 library
MIT License
636 stars 187 forks source link

EthereumSignedTransaction init always throws rlpItemInvalid #165

Closed robinwit closed 6 months ago

robinwit commented 1 year ago

Hi,

I'm trying to read an existing signed transaction in RLP format with Web3.swift:

let rlpBytes = Array(rlpData.bytes[1...]) // drop prefix
let rlpItems = try! RLPDecoder().decode(rlpBytes)
let tx = try! EthereumSignedTransaction(rlp: rlpItems)

The init of EthereumSignedTransaction runs fine, all the fields are properly extracted, but then line 583 is hit, which simply just seems to throw an error, always?

Shouldn't this be an else? I can open a PR to fix it. Is this intended behavior in some way or am I misinterpreting the API?