Skip to content

Commit 6d1f512

Browse files
committed
deprecations: replace all TBDs with 0.31.0
We accidentally released 0.30.0 and 0.31.0 with "future" deprecations. Most users will not see these since the lint for them is different from the normal deprecation warning (and it's undocumented except to say that we "should not use" future deprecations, even though it works and there is no alternative). Somewhat fortunately, in 0.30.x we messed up the deprecations and provided an inconsistent and weird API to replace the old functions. But because we messed up the deprecation messages, we can pretend we didn't do it and just mark the deprecations as having started in 0.31.x
1 parent 4045eb8 commit 6d1f512

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/ecdh.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl SharedSecret {
6464
pub fn from_bytes(bytes: [u8; SHARED_SECRET_SIZE]) -> SharedSecret { SharedSecret(bytes) }
6565

6666
/// Creates a shared secret from `bytes` slice.
67-
#[deprecated(since = "TBD", note = "Use `from_bytes` instead.")]
67+
#[deprecated(since = "0.31.0", note = "Use `from_bytes` instead.")]
6868
#[inline]
6969
pub fn from_slice(bytes: &[u8]) -> Result<SharedSecret, Error> {
7070
match bytes.len() {

src/key.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl SecretKey {
220220
/// use secp256k1::SecretKey;
221221
/// let sk = SecretKey::from_slice(&[0xcd; 32]).expect("32 bytes, within curve order");
222222
/// ```
223-
#[deprecated(since = "TBD", note = "Use `from_byte_array` instead.")]
223+
#[deprecated(since = "0.31.0", note = "Use `from_byte_array` instead.")]
224224
#[inline]
225225
pub fn from_slice(data: &[u8]) -> Result<SecretKey, Error> {
226226
match <[u8; constants::SECRET_KEY_SIZE]>::try_from(data) {
@@ -861,7 +861,7 @@ impl Keypair {
861861
///
862862
/// [`Error::InvalidSecretKey`] if the slice is not exactly 32 bytes long,
863863
/// or if the encoded number is an invalid scalar.
864-
#[deprecated(since = "TBD", note = "Use `from_seckey_byte_array` instead.")]
864+
#[deprecated(since = "0.31.0", note = "Use `from_seckey_byte_array` instead.")]
865865
#[inline]
866866
pub fn from_seckey_slice<C: Signing>(
867867
secp: &Secp256k1<C>,
@@ -1240,7 +1240,7 @@ impl XOnlyPublicKey {
12401240
///
12411241
/// Returns [`Error::InvalidPublicKey`] if the length of the data slice is not 32 bytes or the
12421242
/// slice does not represent a valid Secp256k1 point x coordinate.
1243-
#[deprecated(since = "TBD", note = "Use `from_byte_array` instead.")]
1243+
#[deprecated(since = "0.31.0", note = "Use `from_byte_array` instead.")]
12441244
#[inline]
12451245
pub fn from_slice(data: &[u8]) -> Result<XOnlyPublicKey, Error> {
12461246
match <[u8; constants::SCHNORR_PUBLIC_KEY_SIZE]>::try_from(data) {

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ impl Message {
256256
///
257257
/// [secure signature]: https://twitter.com/pwuille/status/1063582706288586752
258258
#[inline]
259-
#[deprecated(since = "TBD", note = "use from_digest instead")]
259+
#[deprecated(since = "0.31.0", note = "use from_digest instead")]
260260
pub fn from_digest_slice(digest: &[u8]) -> Result<Message, Error> {
261261
Ok(Message::from_digest(digest.try_into().map_err(|_| Error::InvalidMessage)?))
262262
}

src/schnorr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl Signature {
7878
pub fn from_byte_array(sig: [u8; constants::SCHNORR_SIGNATURE_SIZE]) -> Self { Self(sig) }
7979

8080
/// Creates a `Signature` directly from a slice.
81-
#[deprecated(since = "TBD", note = "Use `from_byte_array` instead.")]
81+
#[deprecated(since = "0.31.0", note = "Use `from_byte_array` instead.")]
8282
#[inline]
8383
pub fn from_slice(data: &[u8]) -> Result<Signature, Error> {
8484
match data.len() {
@@ -92,7 +92,7 @@ impl Signature {
9292
}
9393

9494
/// Returns a signature as a byte array.
95-
#[deprecated(since = "0.30.0", note = "Use `to_byte_array` instead.")]
95+
#[deprecated(since = "0.31.0", note = "Use `to_byte_array` instead.")]
9696
pub fn serialize(&self) -> [u8; constants::SCHNORR_SIGNATURE_SIZE] { self.0 }
9797

9898
/// Returns a signature as a byte array.

0 commit comments

Comments
 (0)