From 80cf6db98c75abb4c9954cdf62fd729b5dae3b5d Mon Sep 17 00:00:00 2001 From: Thomas Coratger <60488569+tcoratger@users.noreply.github.com> Date: Sat, 10 Aug 2024 09:16:54 -0700 Subject: [PATCH] typo: replace [Block] by [`Block`] in doc (#10254) --- crates/primitives/src/block.rs | 2 +- crates/rpc/rpc-eth-types/src/cache/mod.rs | 10 +++++----- crates/rpc/rpc-types-compat/src/block.rs | 6 +++--- .../rpc/rpc-types-compat/src/engine/payload.rs | 18 +++++++++--------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/crates/primitives/src/block.rs b/crates/primitives/src/block.rs index 1d2482cb708e..a81194fa3ee1 100644 --- a/crates/primitives/src/block.rs +++ b/crates/primitives/src/block.rs @@ -165,7 +165,7 @@ impl Block { self.blob_versioned_hashes_iter().collect() } - /// Calculates a heuristic for the in-memory size of the [Block]. + /// Calculates a heuristic for the in-memory size of the [`Block`]. #[inline] pub fn size(&self) -> usize { self.header.size() + diff --git a/crates/rpc/rpc-eth-types/src/cache/mod.rs b/crates/rpc/rpc-eth-types/src/cache/mod.rs index 6fc0ab9f4812..63daa641b474 100644 --- a/crates/rpc/rpc-eth-types/src/cache/mod.rs +++ b/crates/rpc/rpc-eth-types/src/cache/mod.rs @@ -32,7 +32,7 @@ pub mod db; pub mod metrics; pub mod multi_consumer; -/// The type that can send the response to a requested [Block] +/// The type that can send the response to a requested [`Block`] type BlockTransactionsResponseSender = oneshot::Sender>>>; @@ -140,7 +140,7 @@ impl EthStateCache { this } - /// Requests the [Block] for the block hash + /// Requests the [`Block`] for the block hash /// /// Returns `None` if the block does not exist. pub async fn get_block(&self, block_hash: B256) -> ProviderResult> { @@ -156,14 +156,14 @@ impl EthStateCache { } } - /// Requests the [Block] for the block hash, sealed with the given block hash. + /// Requests the [`Block`] for the block hash, sealed with the given block hash. /// /// Returns `None` if the block does not exist. pub async fn get_sealed_block(&self, block_hash: B256) -> ProviderResult> { Ok(self.get_block(block_hash).await?.map(|block| block.seal(block_hash))) } - /// Requests the transactions of the [Block] + /// Requests the transactions of the [`Block`] /// /// Returns `None` if the block does not exist. pub async fn get_block_transactions( @@ -175,7 +175,7 @@ impl EthStateCache { rx.await.map_err(|_| ProviderError::CacheServiceUnavailable)? } - /// Requests the ecrecovered transactions of the [Block] + /// Requests the ecrecovered transactions of the [`Block`] /// /// Returns `None` if the block does not exist. pub async fn get_block_transactions_ecrecovered( diff --git a/crates/rpc/rpc-types-compat/src/block.rs b/crates/rpc/rpc-types-compat/src/block.rs index bd5b83f2c6bb..05e36fb5f9f8 100644 --- a/crates/rpc/rpc-types-compat/src/block.rs +++ b/crates/rpc/rpc-types-compat/src/block.rs @@ -8,7 +8,7 @@ use reth_primitives::{ }; use reth_rpc_types::{Block, BlockError, BlockTransactions, BlockTransactionsKind, Header}; -/// Converts the given primitive block into a [Block] response with the given +/// Converts the given primitive block into a [`Block`] response with the given /// [`BlockTransactionsKind`] /// /// If a `block_hash` is provided, then this is used, otherwise the block hash is computed. @@ -26,7 +26,7 @@ pub fn from_block( } } -/// Create a new [Block] response from a [primitive block](reth_primitives::Block), using the +/// Create a new [`Block`] response from a [primitive block](reth_primitives::Block), using the /// total difficulty to populate its field in the rpc response. /// /// This will populate the `transactions` field with only the hashes of the transactions in the @@ -48,7 +48,7 @@ pub fn from_block_with_tx_hashes( ) } -/// Create a new [Block] response from a [primitive block](reth_primitives::Block), using the +/// Create a new [`Block`] response from a [primitive block](reth_primitives::Block), using the /// total difficulty to populate its field in the rpc response. /// /// This will populate the `transactions` field with the _full_ diff --git a/crates/rpc/rpc-types-compat/src/engine/payload.rs b/crates/rpc/rpc-types-compat/src/engine/payload.rs index 32dba92495a1..933beb985561 100644 --- a/crates/rpc/rpc-types-compat/src/engine/payload.rs +++ b/crates/rpc/rpc-types-compat/src/engine/payload.rs @@ -12,7 +12,7 @@ use reth_rpc_types::engine::{ ExecutionPayloadV3, ExecutionPayloadV4, PayloadError, }; -/// Converts [`ExecutionPayloadV1`] to [Block] +/// Converts [`ExecutionPayloadV1`] to [`Block`] pub fn try_payload_v1_to_block(payload: ExecutionPayloadV1) -> Result { if payload.extra_data.len() > MAXIMUM_EXTRA_DATA_SIZE { return Err(PayloadError::ExtraData(payload.extra_data)) @@ -72,7 +72,7 @@ pub fn try_payload_v1_to_block(payload: ExecutionPayloadV1) -> Result Result { // this performs the same conversion as the underlying V1 payload, but calculates the // withdrawals root and adds withdrawals @@ -83,7 +83,7 @@ pub fn try_payload_v2_to_block(payload: ExecutionPayloadV2) -> Result Result { // this performs the same conversion as the underlying V2 payload, but inserts the blob gas // used and excess blob gas @@ -95,7 +95,7 @@ pub fn try_payload_v3_to_block(payload: ExecutionPayloadV3) -> Result Result { let ExecutionPayloadV4 { payload_inner, @@ -324,8 +324,8 @@ pub fn try_into_block( /// NOTE: Empty ommers, nonce and difficulty values are validated upon computing block hash and /// comparing the value with `payload.block_hash`. /// -/// Uses [`try_into_block`] to convert from the [`ExecutionPayload`] to [Block] and seals the block -/// with its hash. +/// Uses [`try_into_block`] to convert from the [`ExecutionPayload`] to [`Block`] and seals the +/// block with its hash. /// /// Uses [`validate_block_hash`] to validate the payload block hash and ultimately return the /// [`SealedBlock`]. @@ -340,7 +340,7 @@ pub fn try_into_sealed_block( validate_block_hash(block_hash, base_payload) } -/// Takes the expected block hash and [Block], validating the block and converting it into a +/// Takes the expected block hash and [`Block`], validating the block and converting it into a /// [`SealedBlock`]. /// /// If the provided block hash does not match the block hash computed from the provided block, this @@ -361,7 +361,7 @@ pub fn validate_block_hash( Ok(sealed_block) } -/// Converts [Block] to [`ExecutionPayloadBodyV1`] +/// Converts [`Block`] to [`ExecutionPayloadBodyV1`] pub fn convert_to_payload_body_v1(value: Block) -> ExecutionPayloadBodyV1 { let transactions = value.body.into_iter().map(|tx| { let mut out = Vec::new(); @@ -374,7 +374,7 @@ pub fn convert_to_payload_body_v1(value: Block) -> ExecutionPayloadBodyV1 { } } -/// Converts [Block] to [`ExecutionPayloadBodyV2`] +/// Converts [`Block`] to [`ExecutionPayloadBodyV2`] pub fn convert_to_payload_body_v2(value: Block) -> ExecutionPayloadBodyV2 { let transactions = value.body.into_iter().map(|tx| { let mut out = Vec::new();