reth_primitives_traits/transaction/
mod.rs

1//! Transaction abstraction
2//!
3//! This module provides traits for working with blockchain transactions:
4//! - [`Transaction`] - Basic transaction interface
5//! - [`signed::SignedTransaction`] - Transaction with signature and recovery methods
6//! - [`FullTransaction`] - Transaction with database encoding support
7//!
8//! # Transaction Recovery
9//!
10//! Transaction senders are not stored directly but recovered from signatures.
11//! Use `recover_signer` for post-EIP-2 transactions or `recover_signer_unchecked`
12//! for historical transactions.
13
14pub mod execute;
15pub mod signature;
16pub mod signed;
17
18pub mod error;
19pub mod recover;
20
21pub use alloy_consensus::transaction::{
22    SignerRecoverable, TransactionInfo, TransactionMeta, TxHashRef,
23};
24
25use crate::{InMemorySize, MaybeCompact, MaybeSerde};
26use core::{fmt, hash::Hash};
27
28#[cfg(test)]
29mod access_list;
30
31/// Helper trait that unifies all behaviour required by transaction to support full node operations.
32pub trait FullTransaction: Transaction + MaybeCompact {}
33
34impl<T> FullTransaction for T where T: Transaction + MaybeCompact {}
35
36/// Abstraction of a transaction.
37pub trait Transaction:
38    Send
39    + Sync
40    + Unpin
41    + Clone
42    + fmt::Debug
43    + Eq
44    + PartialEq
45    + Hash
46    + alloy_consensus::Transaction
47    + InMemorySize
48    + MaybeSerde
49{
50}
51
52impl<T> Transaction for T where
53    T: Send
54        + Sync
55        + Unpin
56        + Clone
57        + fmt::Debug
58        + Eq
59        + PartialEq
60        + Hash
61        + alloy_consensus::Transaction
62        + InMemorySize
63        + MaybeSerde
64{
65}