primitives: use alloy Header struct (#10691)

This commit is contained in:
Thomas Coratger
2024-09-23 14:53:43 +02:00
committed by GitHub
parent 7529d36515
commit ed1de8996d
85 changed files with 826 additions and 991 deletions

View File

@ -2,7 +2,7 @@ use alloy_rpc_types::{Filter, FilteredParams};
use reth_chainspec::ChainSpecBuilder;
use reth_node_ethereum::EthereumNode;
use reth_node_types::NodeTypesWithDBAdapter;
use reth_primitives::{Address, B256};
use reth_primitives::{alloy_primitives::Sealable, Address, SealedHeader, B256};
use reth_provider::{
providers::StaticFileProvider, AccountReader, BlockReader, BlockSource, HeaderProvider,
ProviderFactory, ReceiptProvider, StateProvider, TransactionsProvider,
@ -62,7 +62,9 @@ fn header_provider_example<T: HeaderProvider>(provider: T, number: u64) -> eyre:
// We can convert a header to a sealed header which contains the hash w/o needing to re-compute
// it every time.
let sealed_header = header.seal_slow();
let sealed = header.seal_slow();
let (header, seal) = sealed.into_parts();
let sealed_header = SealedHeader::new(header, seal);
// Can also query the header by hash!
let header_by_hash =