Skip to content

Commit

Permalink
improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Sep 30, 2024
1 parent cd1438c commit 47081f3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 1 addition & 2 deletions crates/eip7702/src/auth_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ mod tests {

/// Bincode-compatible [`SignedAuthorization`] serde implementation.
#[cfg(all(feature = "serde", feature = "serde-bincode-compat"))]
pub mod serde_bincode_compat {
pub(super) mod serde_bincode_compat {
use alloc::borrow::Cow;
use alloy_primitives::Signature;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
Expand All @@ -400,7 +400,6 @@ pub mod serde_bincode_compat {
/// ```
#[derive(Debug, Serialize, Deserialize)]
struct SignedAuthorization<'a> {
// Bincode doesn't support `#[serde(flatten)]`: <https://github.com/bincode-org/bincode/issues/167#issuecomment-897629039>
inner: Cow<'a, Authorization>,
signature: Cow<'a, Signature>,
}
Expand Down
12 changes: 12 additions & 0 deletions crates/eip7702/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ mod auth_list;
pub use auth_list::*;

pub mod constants;

/// Bincode-compatible serde implementations for EIP-7702 types.
///
/// `bincode` crate doesn't work with `#[serde(flatten)]` attribute, but some of the EIP-7702 types
/// require flattenning for RPC compatibility. This module makes so that all fields are
/// non-flattenned.
///
/// Read more: <https://github.com/bincode-org/bincode/issues/167#issuecomment-897629039>
#[cfg(all(feature = "serde", feature = "serde-bincode-compat"))]
pub mod serde_bincode_compat {
pub use super::auth_list::serde_bincode_compat::*;
}

0 comments on commit 47081f3

Please sign in to comment.