Skip to content

Commit 4b2fbd1

Browse files
committed
More lax workaround for rustdocs bug
1 parent b36cdd8 commit 4b2fbd1

File tree

5 files changed

+29
-18
lines changed

5 files changed

+29
-18
lines changed

Diff for: crates/optimism/rpc/src/eth/block.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ use alloy_consensus::{transaction::TransactionMeta, BlockHeader};
44
use alloy_rpc_types_eth::{BlockId, Header};
55
use op_alloy_rpc_types::OpTransactionReceipt;
66
use reth_chainspec::ChainSpecProvider;
7+
use reth_node_api::NodePrimitives;
78
use reth_optimism_chainspec::OpChainSpec;
8-
use reth_primitives_traits::{HeaderTy, SignedTransaction};
9+
use reth_optimism_primitives::{OpReceipt, OpTransactionSigned};
10+
use reth_primitives_traits::{BlockBody as _, HeaderTy, SignedTransaction};
911
use reth_rpc_eth_api::{
1012
helpers::{EthBlocks, LoadBlock, LoadPendingBlock, LoadReceipt, SpawnBlocking},
1113
types::RpcTypes,
@@ -18,7 +20,10 @@ use super::OpNodeCore;
1820

1921
impl<N> EthBlocks for OpEthApi<N>
2022
where
21-
N: OpNodeCore<Provider: ChainSpecProvider<ChainSpec = OpChainSpec>>,
23+
N: OpNodeCore<
24+
Primitives: NodePrimitives<Receipt = OpReceipt, SignedTx = OpTransactionSigned>,
25+
Provider: ChainSpecProvider<ChainSpec = OpChainSpec>,
26+
>,
2227
Self: LoadBlock<
2328
Error = OpEthApiError,
2429
Primitives = N::Primitives,
@@ -45,6 +50,7 @@ where
4550
return block
4651
.body()
4752
.transactions()
53+
.iter()
4854
.zip(receipts.iter())
4955
.enumerate()
5056
.map(|(idx, (tx, receipt))| -> Result<_, _> {

Diff for: crates/optimism/rpc/src/eth/mod.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ use reth_chain_state::CanonStateSubscriptions;
1515
use reth_chainspec::{ChainSpecProvider, EthChainSpec, EthereumHardforks};
1616
use reth_evm::ConfigureEvm;
1717
use reth_network_api::NetworkInfo;
18-
use reth_node_api::{FullNodeComponents, NodeTypes, PrimitivesTy};
18+
use reth_node_api::{FullNodeComponents, NodePrimitives, NodeTypes, PrimitivesTy};
1919
use reth_node_builder::rpc::{EthApiBuilder, EthApiCtx};
20-
use reth_optimism_primitives::{OpBlock, OpPrimitives, OpReceipt, OpTransactionSigned};
21-
use reth_primitives_traits::{BlockTy, ReceiptTy, TxTy};
20+
use reth_optimism_primitives::OpPrimitives;
21+
use reth_primitives_traits::{BlockTy, HeaderTy, ReceiptTy, TxTy};
2222
use reth_rpc::eth::{core::EthApiInner, DevSigner};
2323
use reth_rpc_eth_api::{
2424
helpers::{
@@ -51,24 +51,24 @@ pub type EthApiNodeBackend<N> = EthApiInner<
5151
/// A helper trait with requirements for [`RpcNodeCore`] to be used in [`OpEthApi`].
5252
pub trait OpNodeCore:
5353
RpcNodeCore<
54-
Primitives = OpPrimitives,
54+
Primitives: NodePrimitives,
5555
Provider: BlockReader<
56-
Block = OpBlock,
57-
Header = alloy_consensus::Header,
58-
Transaction = OpTransactionSigned,
59-
Receipt = OpReceipt,
56+
Block = BlockTy<Self::Primitives>,
57+
Header = HeaderTy<Self::Primitives>,
58+
Transaction = TxTy<Self::Primitives>,
59+
Receipt = ReceiptTy<Self::Primitives>,
6060
>,
6161
>
6262
{
6363
}
6464
impl<T> OpNodeCore for T where
6565
T: RpcNodeCore<
66-
Primitives = OpPrimitives,
66+
Primitives: NodePrimitives,
6767
Provider: BlockReader<
68-
Block = OpBlock,
69-
Header = alloy_consensus::Header,
70-
Transaction = OpTransactionSigned,
71-
Receipt = OpReceipt,
68+
Block = BlockTy<Self::Primitives>,
69+
Header = HeaderTy<Self::Primitives>,
70+
Transaction = TxTy<Self::Primitives>,
71+
Receipt = ReceiptTy<Self::Primitives>,
7272
>,
7373
>
7474
{

Diff for: crates/optimism/rpc/src/eth/pending_block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ where
3737
prev_randao: B256::random(),
3838
gas_limit: parent.gas_limit(),
3939
parent_beacon_block_root: parent.parent_beacon_block_root(),
40-
extra_data: parent.extra_data.clone(),
40+
extra_data: parent.extra_data().clone(),
4141
})
4242
}
4343

Diff for: crates/optimism/rpc/src/eth/receipt.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use alloy_rpc_types_eth::{Log, TransactionReceipt};
66
use op_alloy_consensus::{OpDepositReceipt, OpDepositReceiptWithBloom, OpReceiptEnvelope};
77
use op_alloy_rpc_types::{L1BlockInfo, OpTransactionReceipt, OpTransactionReceiptFields};
88
use reth_chainspec::ChainSpecProvider;
9+
use reth_node_api::NodePrimitives;
910
use reth_optimism_chainspec::OpChainSpec;
1011
use reth_optimism_evm::RethL1BlockInfo;
1112
use reth_optimism_forks::OpHardforks;
@@ -20,7 +21,10 @@ use super::OpNodeCore;
2021

2122
impl<N> LoadReceipt for OpEthApi<N>
2223
where
23-
N: OpNodeCore<Provider: ChainSpecProvider<ChainSpec = OpChainSpec>>,
24+
N: OpNodeCore<
25+
Primitives: NodePrimitives<Receipt = OpReceipt, SignedTx = OpTransactionSigned>,
26+
Provider: ChainSpecProvider<ChainSpec = OpChainSpec>,
27+
>,
2428
Self: RpcNodeCoreExt<Primitives = N::Primitives>,
2529
{
2630
async fn build_transaction_receipt(

Diff for: crates/optimism/rpc/src/eth/transaction.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use alloy_primitives::{Bytes, PrimitiveSignature as Signature, Sealable, Sealed,
55
use alloy_rpc_types_eth::TransactionInfo;
66
use op_alloy_consensus::OpTxEnvelope;
77
use op_alloy_rpc_types::{OpTransactionRequest, Transaction};
8+
use reth_node_api::NodePrimitives;
89
use reth_optimism_primitives::{OpReceipt, OpTransactionSigned};
910
use reth_primitives_traits::TxTy;
1011
use reth_rpc_eth_api::{
@@ -72,7 +73,7 @@ where
7273

7374
impl<N> TransactionCompat<OpTransactionSigned> for OpEthApi<N>
7475
where
75-
N: OpNodeCore,
76+
N: OpNodeCore<Primitives: NodePrimitives<Receipt = OpReceipt>>,
7677
{
7778
type Transaction = Transaction;
7879
type Error = OpEthApiError;

0 commit comments

Comments
 (0)