diff --git a/crates/eips/src/eip7702/auth_list.rs b/crates/eips/src/eip7702/auth_list.rs index c6c05ce81d0..faa2c160ada 100644 --- a/crates/eips/src/eip7702/auth_list.rs +++ b/crates/eips/src/eip7702/auth_list.rs @@ -7,6 +7,8 @@ use alloy_rlp::{BufMut, Decodable, Encodable, Header, RlpDecodable, RlpEncodable /// An unsigned EIP-7702 authorization. #[derive(Debug, Clone, RlpEncodable, RlpDecodable, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] pub struct Authorization { /// The chain ID of the authorization. pub chain_id: ChainId, @@ -71,8 +73,10 @@ impl Authorization { } /// A signed EIP-7702 authorization. -#[derive(Debug, Clone, RlpEncodable, RlpDecodable)] +#[derive(Debug, Clone, RlpEncodable, RlpDecodable, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct SignedAuthorization { + #[cfg_attr(feature = "serde", serde(flatten))] inner: Authorization, signature: S, } @@ -113,7 +117,9 @@ impl Deref for SignedAuthorization { /// A recovered authorization. #[derive(Debug, Clone, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct RecoveredAuthorization { + #[cfg_attr(feature = "serde", serde(flatten))] inner: Authorization, authority: Option
, } @@ -142,6 +148,7 @@ impl Deref for RecoveredAuthorization { /// /// The wrapper type is used for RLP encoding and decoding. #[derive(Default, Debug, Copy, Clone, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct OptionalNonce(Option); impl OptionalNonce {