mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
Reth primitives traits tx type (#11720)
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
This commit is contained in:
@@ -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"))]
|
||||
|
||||
28
crates/primitives-traits/src/tx_type.rs
Normal file
28
crates/primitives-traits/src/tx_type.rs
Normal 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
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user