fix(primitives): Exhaustive Matching on TxType Primitive Encoding (#5315)

This commit is contained in:
refcell.eth
2023-11-05 20:12:24 +01:00
committed by GitHub
parent 18a55d240b
commit c258659dd9

View File

@ -72,7 +72,15 @@ impl Compact for TxType {
TxType::Legacy => 0,
TxType::EIP2930 => 1,
TxType::EIP1559 => 2,
_ => {
TxType::EIP4844 => {
// Write the full transaction type to the buffer when encoding > 3.
// This allows compat decoding the [TyType] from a single byte as
// opposed to 2 bits for the backwards-compatible encoding.
buf.put_u8(self as u8);
3
}
#[cfg(feature = "optimism")]
TxType::DEPOSIT => {
buf.put_u8(self as u8);
3
}