mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
typo: replace [Block] by [Block] in doc (#10254)
This commit is contained in:
@ -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() +
|
||||
|
||||
10
crates/rpc/rpc-eth-types/src/cache/mod.rs
vendored
10
crates/rpc/rpc-eth-types/src/cache/mod.rs
vendored
@ -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>>>>;
|
||||
|
||||
@ -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>> {
|
||||
@ -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(
|
||||
@ -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(
|
||||
|
||||
@ -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_
|
||||
|
||||
@ -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))
|
||||
@ -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
|
||||
@ -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
|
||||
@ -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,
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user