mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: make block field private (#13628)
This commit is contained in:
@ -678,8 +678,10 @@ mod tests {
|
||||
);
|
||||
|
||||
let headers = blocks.iter().map(|block| block.header.clone()).collect::<Vec<_>>();
|
||||
let bodies =
|
||||
blocks.into_iter().map(|block| (block.hash(), block.body)).collect::<HashMap<_, _>>();
|
||||
let bodies = blocks
|
||||
.into_iter()
|
||||
.map(|block| (block.hash(), block.into_body()))
|
||||
.collect::<HashMap<_, _>>();
|
||||
|
||||
insert_headers(db.db(), &headers);
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ pub(crate) fn zip_blocks<'a, H: Clone + BlockHeader + 'a, B>(
|
||||
if header.is_empty() {
|
||||
BlockResponse::Empty(header.clone())
|
||||
} else {
|
||||
BlockResponse::Full(SealedBlock { header: header.clone(), body })
|
||||
BlockResponse::Full(SealedBlock::new(header.clone(), body))
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
|
||||
@ -29,7 +29,7 @@ pub(crate) fn generate_bodies(
|
||||
);
|
||||
|
||||
let headers = blocks.iter().map(|block| block.header.clone()).collect();
|
||||
let bodies = blocks.into_iter().map(|block| (block.hash(), block.body)).collect();
|
||||
let bodies = blocks.into_iter().map(|block| (block.hash(), block.into_body())).collect();
|
||||
|
||||
(headers, bodies)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user