use eth_valkyoth_primitives::B256;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct MptProofRoot(B256);
impl MptProofRoot {
#[must_use]
pub const fn from_b256(value: B256) -> Self {
Self(value)
}
#[must_use]
pub const fn to_b256(self) -> B256 {
self.0
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct TransactionTrieRoot(B256);
impl TransactionTrieRoot {
#[must_use]
pub const fn from_b256(value: B256) -> Self {
Self(value)
}
#[must_use]
pub const fn to_b256(self) -> B256 {
self.0
}
}
impl From<TransactionTrieRoot> for MptProofRoot {
fn from(value: TransactionTrieRoot) -> Self {
Self(value.to_b256())
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct ReceiptTrieRoot(B256);
impl ReceiptTrieRoot {
#[must_use]
pub const fn from_b256(value: B256) -> Self {
Self(value)
}
#[must_use]
pub const fn to_b256(self) -> B256 {
self.0
}
}
impl From<ReceiptTrieRoot> for MptProofRoot {
fn from(value: ReceiptTrieRoot) -> Self {
Self(value.to_b256())
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct VerifiedTransactionInclusion {
index: u64,
root: TransactionTrieRoot,
}
impl VerifiedTransactionInclusion {
pub(crate) const fn new(index: u64, root: TransactionTrieRoot) -> Self {
Self { index, root }
}
#[must_use]
pub const fn index(self) -> u64 {
self.index
}
#[must_use]
pub const fn root(self) -> TransactionTrieRoot {
self.root
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct VerifiedReceiptInclusion {
index: u64,
root: ReceiptTrieRoot,
}
impl VerifiedReceiptInclusion {
pub(crate) const fn new(index: u64, root: ReceiptTrieRoot) -> Self {
Self { index, root }
}
#[must_use]
pub const fn index(self) -> u64 {
self.index
}
#[must_use]
pub const fn root(self) -> ReceiptTrieRoot {
self.root
}
}