alloy-rs / core

High-performance, well-tested & documented core libraries for Ethereum, in Rust
https://alloy.rs
Apache License 2.0
763 stars 137 forks source link

fix: handle 0 for inverting eip155 parity. #633

Closed jafar75 closed 3 months ago

jafar75 commented 3 months ago

Motivation

As mentioned in #630 , there is a corner case for inverting parity with value of Eip155(0). Program will try to return Eip155(-1) which is panic issue.

Solution

One should handle the 0 case separately and return Eip155(1) as the inverted output.

PR Checklist

prestwich commented 3 months ago

CI is unrelated