Skip to content

Commit

Permalink
typo: replace [Block] by [Block] in doc (#10254)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger committed Aug 10, 2024
1 parent 25ab85c commit 80cf6db
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion crates/primitives/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() +
Expand Down
10 changes: 5 additions & 5 deletions crates/rpc/rpc-eth-types/src/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ProviderResult<Option<Vec<TransactionSigned>>>>;

Expand Down Expand Up @@ -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<Option<Block>> {
Expand All @@ -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<Option<SealedBlock>> {
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(
Expand All @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions crates/rpc/rpc-types-compat/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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_
Expand Down
18 changes: 9 additions & 9 deletions crates/rpc/rpc-types-compat/src/engine/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Block, PayloadError> {
if payload.extra_data.len() > MAXIMUM_EXTRA_DATA_SIZE {
return Err(PayloadError::ExtraData(payload.extra_data))
Expand Down Expand Up @@ -72,7 +72,7 @@ pub fn try_payload_v1_to_block(payload: ExecutionPayloadV1) -> Result<Block, Pay
})
}

/// Converts [`ExecutionPayloadV2`] to [Block]
/// Converts [`ExecutionPayloadV2`] to [`Block`]
pub fn try_payload_v2_to_block(payload: ExecutionPayloadV2) -> Result<Block, PayloadError> {
// this performs the same conversion as the underlying V1 payload, but calculates the
// withdrawals root and adds withdrawals
Expand All @@ -83,7 +83,7 @@ pub fn try_payload_v2_to_block(payload: ExecutionPayloadV2) -> Result<Block, Pay
Ok(base_sealed_block)
}

/// Converts [`ExecutionPayloadV3`] to [Block]
/// Converts [`ExecutionPayloadV3`] to [`Block`]
pub fn try_payload_v3_to_block(payload: ExecutionPayloadV3) -> Result<Block, PayloadError> {
// this performs the same conversion as the underlying V2 payload, but inserts the blob gas
// used and excess blob gas
Expand All @@ -95,7 +95,7 @@ pub fn try_payload_v3_to_block(payload: ExecutionPayloadV3) -> Result<Block, Pay
Ok(base_block)
}

/// Converts [`ExecutionPayloadV4`] to [Block]
/// Converts [`ExecutionPayloadV4`] to [`Block`]
pub fn try_payload_v4_to_block(payload: ExecutionPayloadV4) -> Result<Block, PayloadError> {
let ExecutionPayloadV4 {
payload_inner,
Expand Down Expand Up @@ -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`].
Expand All @@ -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
Expand All @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 80cf6db

Please sign in to comment.