reth_optimism_payload_builder/
traits.rs1use alloy_consensus::BlockBody;
2use reth_optimism_primitives::{transaction::OpTransaction, DepositReceipt};
3use reth_payload_primitives::PayloadBuilderAttributes;
4use reth_primitives_traits::{FullBlockHeader, NodePrimitives, SignedTransaction, WithEncoded};
5
6use crate::OpPayloadBuilderAttributes;
7
8pub trait OpPayloadPrimitives:
10 NodePrimitives<
11 Receipt: DepositReceipt,
12 SignedTx = Self::_TX,
13 BlockBody = BlockBody<Self::_TX, Self::_Header>,
14 BlockHeader = Self::_Header,
15>
16{
17 type _TX: SignedTransaction + OpTransaction;
19 type _Header: FullBlockHeader;
21}
22
23impl<Tx, T, Header> OpPayloadPrimitives for T
24where
25 Tx: SignedTransaction + OpTransaction,
26 T: NodePrimitives<
27 SignedTx = Tx,
28 Receipt: DepositReceipt,
29 BlockBody = BlockBody<Tx, Header>,
30 BlockHeader = Header,
31 >,
32 Header: FullBlockHeader,
33{
34 type _TX = Tx;
35 type _Header = Header;
36}
37
38pub trait OpAttributes: PayloadBuilderAttributes {
40 type Transaction: SignedTransaction;
42
43 fn no_tx_pool(&self) -> bool;
45
46 fn sequencer_transactions(&self) -> &[WithEncoded<Self::Transaction>];
48}
49
50impl<T: SignedTransaction> OpAttributes for OpPayloadBuilderAttributes<T> {
51 type Transaction = T;
52
53 fn no_tx_pool(&self) -> bool {
54 self.no_tx_pool
55 }
56
57 fn sequencer_transactions(&self) -> &[WithEncoded<Self::Transaction>] {
58 &self.transactions
59 }
60}