Skip to content

Commit

Permalink
chore(consensus): OpTxType Conversion (#283)
Browse files Browse the repository at this point in the history
### Description

Upstreams a small `OpTxType` conversion to `alloy_primitives::U8` from
reth.

---------

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
  • Loading branch information
refcell and mattsse authored Nov 18, 2024
1 parent 2dff760 commit 3b1746d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/consensus/src/transaction/tx_type.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Contains the transaction type identifier for Optimism.

use alloy_eips::eip2718::Eip2718Error;
use alloy_primitives::U64;
use alloy_primitives::{U64, U8};
use alloy_rlp::{BufMut, Decodable, Encodable};
use derive_more::Display;

Expand Down Expand Up @@ -50,6 +50,12 @@ impl arbitrary::Arbitrary<'_> for OpTxType {
}
}

impl From<OpTxType> for U8 {
fn from(tx_type: OpTxType) -> Self {
Self::from(u8::from(tx_type))
}
}

impl From<OpTxType> for u8 {
fn from(v: OpTxType) -> Self {
v as Self
Expand Down

0 comments on commit 3b1746d

Please sign in to comment.