chore: rm uneccessary serde mod (#13681)

This commit is contained in:
Matthias Seitz
2025-01-06 21:06:43 +01:00
committed by GitHub
parent 682b2b2cd3
commit 895dda5312

View File

@ -20,7 +20,6 @@ use serde::{Deserialize, Serialize};
))] ))]
pub struct Receipt { pub struct Receipt {
/// Receipt type. /// Receipt type.
#[serde(with = "tx_type_serde")]
pub tx_type: TxType, pub tx_type: TxType,
/// If transaction is executed successfully. /// If transaction is executed successfully.
/// ///
@ -185,25 +184,3 @@ impl InMemorySize for Receipt {
} }
impl reth_primitives_traits::Receipt for Receipt {} impl reth_primitives_traits::Receipt for Receipt {}
/// TODO: Remove once <https://github.com/alloy-rs/alloy/pull/1780> is released.
mod tx_type_serde {
use alloy_primitives::{U64, U8};
use super::*;
pub(crate) fn serialize<S>(tx_type: &TxType, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let value: U8 = (*tx_type).into();
value.serialize(serializer)
}
pub(crate) fn deserialize<'de, D>(deserializer: D) -> Result<TxType, D::Error>
where
D: serde::Deserializer<'de>,
{
U64::deserialize(deserializer)?.try_into().map_err(serde::de::Error::custom)
}
}