chore: make SealedBlock.header field private (#13646)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
DevOrbitlabs
2025-01-08 02:44:39 +07:00
committed by GitHub
parent 3e980e61d8
commit 35392bd8e9
30 changed files with 169 additions and 161 deletions

View File

@ -677,7 +677,7 @@ mod tests {
BlockRangeParams { parent: Some(B256::ZERO), tx_count: 1..2, ..Default::default() },
);
let headers = blocks.iter().map(|block| block.header.clone()).collect::<Vec<_>>();
let headers = blocks.iter().map(|block| block.sealed_header().clone()).collect::<Vec<_>>();
let bodies = blocks
.into_iter()
.map(|block| (block.hash(), block.into_body()))

View File

@ -194,7 +194,7 @@ where
// Body is invalid, put the header back and return an error
let hash = block.hash();
let number = block.number();
self.pending_headers.push_front(block.header);
self.pending_headers.push_front(block.into_sealed_header());
return Err(DownloadError::BodyValidation {
hash,
number,

View File

@ -28,7 +28,7 @@ pub(crate) fn generate_bodies(
BlockRangeParams { parent: Some(B256::ZERO), tx_count: 0..2, ..Default::default() },
);
let headers = blocks.iter().map(|block| block.header.clone()).collect();
let headers = blocks.iter().map(|block| block.sealed_header().clone()).collect();
let bodies = blocks.into_iter().map(|block| (block.hash(), block.into_body())).collect();
(headers, bodies)