chore: use alloy's blockwithparent (#13052)

This commit is contained in:
Matthias Seitz
2024-12-02 11:09:24 +01:00
committed by GitHub
parent 04f8c58485
commit ae3b3ddf42
5 changed files with 7 additions and 22 deletions

View File

@ -1,5 +1,5 @@
mod sealed;
pub use sealed::{BlockWithParent, Header, SealedHeader};
pub use sealed::{Header, SealedHeader};
mod error;
pub use error::HeaderError;

View File

@ -1,26 +1,13 @@
use crate::InMemorySize;
pub use alloy_consensus::Header;
use core::mem;
use alloy_consensus::Sealed;
use alloy_eips::BlockNumHash;
use alloy_primitives::{keccak256, BlockHash, Sealable, B256};
use alloy_primitives::{keccak256, BlockHash, Sealable};
use alloy_rlp::{Decodable, Encodable};
use bytes::BufMut;
use core::mem;
use derive_more::{AsRef, Deref};
use crate::InMemorySize;
/// A helper struct to store the block number/hash and its parent hash.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct BlockWithParent {
/// Parent hash.
pub parent: B256,
/// Block number/hash.
pub block: BlockNumHash,
}
/// A [`Header`] that is sealed at a precalculated hash, use [`SealedHeader::unseal()`] if you want
/// to modify header.
#[derive(Debug, Clone, PartialEq, Eq, Hash, AsRef, Deref)]

View File

@ -58,7 +58,7 @@ pub use storage::StorageEntry;
pub mod header;
#[cfg(any(test, feature = "arbitrary", feature = "test-utils"))]
pub use header::test_utils;
pub use header::{BlockWithParent, Header, HeaderError, SealedHeader};
pub use header::{Header, HeaderError, SealedHeader};
/// Bincode-compatible serde implementations for common abstracted types in Reth.
///