Skip to content

Commit

Permalink
refactor: remove Signature generic
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Sep 2, 2024
1 parent ea7f594 commit 929deb1
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 128 deletions.
10 changes: 1 addition & 9 deletions crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,14 @@ mod signed;
pub use signed::{BigIntConversionError, ParseSignedError, Sign, Signed};

mod signature;
pub use signature::{to_eip155_v, Parity, SignatureError};
pub use signature::{to_eip155_v, Parity, Signature, 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 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 929deb1

Please sign in to comment.