reth_optimism_payload_builder/
traits.rs

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