reth_optimism_payload_builder/
traits.rs

1use alloy_consensus::{BlockBody, Header};
2use reth_optimism_primitives::{transaction::signed::OpTransaction, DepositReceipt};
3use reth_primitives::NodePrimitives;
4use reth_primitives_traits::SignedTransaction;
5
6/// Helper trait to encapsulate common bounds on [`NodePrimitives`] for OP payload builder.
7pub trait OpPayloadPrimitives:
8    NodePrimitives<
9    Receipt: DepositReceipt,
10    SignedTx = Self::_TX,
11    BlockHeader = Header,
12    BlockBody = BlockBody<Self::_TX>,
13>
14{
15    /// Helper AT to bound [`NodePrimitives::Block`] type without causing bound cycle.
16    type _TX: SignedTransaction + OpTransaction;
17}
18
19impl<Tx, T> OpPayloadPrimitives for T
20where
21    Tx: SignedTransaction + OpTransaction,
22    T: NodePrimitives<
23        SignedTx = Tx,
24        Receipt: DepositReceipt,
25        BlockHeader = Header,
26        BlockBody = BlockBody<Tx>,
27    >,
28{
29    type _TX = Tx;
30}