chore!: make senders fields private (#13752)

This commit is contained in:
Matthias Seitz
2025-01-09 14:58:09 +01:00
committed by GitHub
parent 66f934b8d0
commit bf65ed45c5
15 changed files with 117 additions and 56 deletions

View File

@ -648,7 +648,7 @@ impl<N: NodePrimitives> BlockState<N> {
pub fn sealed_block_with_senders(&self) -> SealedBlockWithSenders<N::Block> {
let block = self.block.block().clone();
let senders = self.block.senders().clone();
SealedBlockWithSenders { block, senders }
SealedBlockWithSenders::new_unchecked(block, senders)
}
/// Returns the hash of executed block that determines the state.
@ -840,7 +840,7 @@ impl<N: NodePrimitives> ExecutedBlock<N> {
///
/// Note: this clones the block and senders.
pub fn sealed_block_with_senders(&self) -> SealedBlockWithSenders<N::Block> {
SealedBlockWithSenders { block: (*self.block).clone(), senders: (*self.senders).clone() }
SealedBlockWithSenders::new_unchecked((*self.block).clone(), (*self.senders).clone())
}
/// Returns a reference to the block's execution outcome

View File

@ -207,9 +207,10 @@ impl<N: NodePrimitives> TestBlockBuilder<N> {
) -> ExecutedBlock {
let block_with_senders = self.generate_random_block(block_number, parent_hash);
let (block, senders) = block_with_senders.split();
ExecutedBlock::new(
Arc::new(block_with_senders.block.clone()),
Arc::new(block_with_senders.senders),
Arc::new(block),
Arc::new(senders),
Arc::new(ExecutionOutcome::new(
BundleState::default(),
receipts,