Skip to content

Commit

Permalink
refactor: remove Signature generic (#719)
Browse files Browse the repository at this point in the history
* refactor: remove Signature generic

* clippy

* fixes

* fixes
  • Loading branch information
klkvr authored Sep 6, 2024
1 parent 446b9d2 commit 1b98d56
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 140 deletions.
5 changes: 0 additions & 5 deletions crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ pub use alloy_primitives as primitives;
#[doc(no_inline)]
pub use primitives::{hex, uint};

#[cfg(feature = "unstable-doc")]
#[doc(hidden)]
#[allow(unused_imports)]
pub use primitives::PrivateSignature as _;

#[cfg(feature = "dyn-abi")]
#[doc(inline)]
pub use alloy_dyn_abi as dyn_abi;
Expand Down
16 changes: 1 addition & 15 deletions crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,7 @@ mod signed;
pub use signed::{BigIntConversionError, ParseSignedError, Sign, Signed};

mod signature;
pub use signature::{to_eip155_v, Parity, SignatureError};

/// Only available for documentation purposes.
// Without this visible (not `#[doc(hidden)]`) re-export, `rustdoc` will not generate documentation
// for the `Signature` type alias below.
#[cfg(feature = "unstable-doc")]
pub use signature::Signature as PrivateSignature;

/// An ECDSA Signature, consisting of V, R, and S.
#[cfg(feature = "k256")]
pub type Signature = signature::Signature<k256::ecdsa::Signature>;

/// An ECDSA Signature, consisting of V, R, and S.
#[cfg(not(feature = "k256"))]
pub type Signature = signature::Signature<()>;
pub use signature::{to_eip155_v, Parity, Signature, SignatureError};

pub mod utils;
pub use utils::{eip191_hash_message, keccak256, Keccak256};
Expand Down
3 changes: 0 additions & 3 deletions crates/primitives/src/signature/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ mod parity;
pub use parity::Parity;

mod sig;
#[cfg(feature = "unstable-doc")]
pub use sig::Signature;
#[cfg(not(feature = "unstable-doc"))]
pub(crate) use sig::Signature;

mod utils;
pub use utils::to_eip155_v;
Loading

0 comments on commit 1b98d56

Please sign in to comment.