Skip to content

Commit

Permalink
chore: unify unchecked naming (#13391)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Dec 13, 2024
1 parent d087488 commit a7ebd15
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/exex/exex/src/backfill/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ where
// TODO(alexey): report gas metrics using `block.header.gas_used`

// Seal the block back and save it
blocks.push(block.seal(hash));
blocks.push(block.seal_unchecked(hash));

// Check if we should commit now
let bundle_size_hint = executor.size_hint().unwrap_or_default() as u64;
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/rpc/src/eth/pending_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ where
.block_with_senders(block_id, Default::default())
.map_err(Self::Error::from_eth_err)?
.ok_or(EthApiError::HeaderNotFound(block_id.into()))?
.seal(latest.hash());
.seal_unchecked(latest.hash());

let receipts = self
.provider()
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl<B: reth_primitives_traits::Block> BlockWithSenders<B> {
///
/// WARNING: This method does not perform validation whether the hash is correct.
#[inline]
pub fn seal(self, hash: B256) -> SealedBlockWithSenders<B> {
pub fn seal_unchecked(self, hash: B256) -> SealedBlockWithSenders<B> {
let Self { block, senders } = self;
SealedBlockWithSenders::<B> { block: block.seal(hash), senders }
}
Expand Down
2 changes: 1 addition & 1 deletion crates/stages/stages/src/stages/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ where
if !blocks.is_empty() {
let blocks = blocks.into_iter().map(|block| {
let hash = block.header().hash_slow();
block.seal(hash)
block.seal_unchecked(hash)
});

let previous_input =
Expand Down
4 changes: 2 additions & 2 deletions crates/storage/provider/src/providers/blockchain_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2577,7 +2577,7 @@ mod tests {
.unseal::<reth_primitives::Block>()
.with_recovered_senders()
.unwrap()
.seal(block.hash())
.seal_unchecked(block.hash())
)
),
(BlockHashOrNumber::Number(u64::MAX), TransactionVariant::WithHash)
Expand All @@ -2593,7 +2593,7 @@ mod tests {
.unseal::<reth_primitives::Block>()
.with_recovered_senders()
.unwrap()
.seal(block.hash())
.seal_unchecked(block.hash())
)
),
(BlockHashOrNumber::Hash(B256::random()), TransactionVariant::WithHash)
Expand Down

0 comments on commit a7ebd15

Please sign in to comment.