Skip to content

Commit

Permalink
chore: mark Signature as deprecated (#819)
Browse files Browse the repository at this point in the history
* chore: mark Signature as `deprecated`

* fix: put deprecation notice on the struct defs

* add `allow(deprecated)`

* add `allow(deprecated)`
  • Loading branch information
moricho authored Dec 9, 2024
1 parent dc0de77 commit ed0837c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ mod signed;
pub use signed::{BigIntConversionError, ParseSignedError, Sign, Signed};

mod signature;
pub use signature::{
normalize_v, to_eip155_v, Parity, PrimitiveSignature, Signature, SignatureError,
};
pub use signature::{normalize_v, to_eip155_v, PrimitiveSignature, SignatureError};
#[allow(deprecated)]
pub use signature::{Parity, Signature};

pub mod utils;
pub use utils::{eip191_hash_message, keccak256, Keccak256};
Expand Down
4 changes: 4 additions & 0 deletions crates/primitives/src/signature/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
mod error;
pub use error::SignatureError;

#[allow(deprecated)]
mod parity;
#[allow(deprecated)]
pub use parity::Parity;

#[allow(deprecated)]
mod sig;
#[allow(deprecated)]
pub use sig::Signature;

mod utils;
Expand Down
1 change: 1 addition & 0 deletions crates/primitives/src/signature/parity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::{

/// The parity of the signature, stored as either a V value (which may include
/// a chain id), or the y-parity.
#[deprecated(since = "0.8.15", note = "see https://github.com/alloy-rs/core/pull/776")]
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
#[cfg_attr(feature = "arbitrary", derive(derive_arbitrary::Arbitrary, proptest_derive::Arbitrary))]
pub enum Parity {
Expand Down
1 change: 1 addition & 0 deletions crates/primitives/src/signature/sig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const SECP256K1N_ORDER: U256 =
uint!(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141_U256);

/// An Ethereum ECDSA signature.
#[deprecated(since = "0.8.15", note = "use PrimitiveSignature instead")]
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
pub struct Signature {
v: Parity,
Expand Down

0 comments on commit ed0837c

Please sign in to comment.