Reth primitives traits tx type (#11720)

Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
This commit is contained in:
0xriazaka.eth
2024-10-30 22:45:16 +01:00
committed by GitHub
parent 09c666d676
commit b42b189210
2 changed files with 32 additions and 0 deletions

View File

@@ -45,6 +45,10 @@ pub use alloy_primitives::{logs_bloom, Log, LogData};
mod storage;
pub use storage::StorageEntry;
/// Transaction types
pub mod tx_type;
pub use tx_type::TxType;
/// Common header types
pub mod header;
#[cfg(any(test, feature = "arbitrary", feature = "test-utils"))]

View File

@@ -0,0 +1,28 @@
use alloy_eips::eip2718::Eip2718Error;
use alloy_primitives::{U64, U8};
use alloy_rlp::{Decodable, Encodable};
use core::fmt::{Debug, Display};
/// Trait representing the behavior of a transaction type.
pub trait TxType:
Into<u8>
+ Into<U8>
+ PartialEq
+ Eq
+ PartialEq<u8>
+ TryFrom<u8, Error = Eip2718Error>
+ TryFrom<u64>
+ TryFrom<U64>
+ From<alloy_consensus::TxType>
+ Debug
+ Display
+ Clone
+ Copy
+ Default
+ Encodable
+ Decodable
+ Send
+ Sync
+ 'static
{
}