You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #728: Feature gate the Keypair::FromStr impl
d600a6c Feature gate the Keypair::FromStr impl (Tobin C. Harding)
Pull request description:
Currently we are panicing if neither `global-context` or `alloc` features are enabled. We do not need to do so, we can just disable the whole impl of `FromStr`.
This was pulled out of #699.
ACKs for top commit:
apoelstra:
ACK d600a6c successfully ran local tests
Kixunil:
ACK d600a6c
Tree-SHA512: 940bec95ce732b4bc482e23da114cb03b767780f93777621c9d0985d1288e36756bdf6f050172eac00f89b6f39aa0efdb30cc77425b6f87505659c8c012981ca
let ctx:Secp256k1<crate::SignOnlyPreallocated> = panic!("The previous implementation was panicking too, please enable the global-context feature of rust-secp256k1");
1016
-
1017
1015
#[allow(clippy::needless_borrow)]
1018
1016
Keypair::from_seckey_str(&ctx, s)
1019
1017
}
@@ -1040,7 +1038,7 @@ impl serde::Serialize for Keypair {
1040
1038
1041
1039
#[cfg(feature = "serde")]
1042
1040
#[allow(unused_variables)]// For `data` under some feature combinations (the unconditional panic below).
1043
-
#[allow(unreachable_code)]// For `Keypair::from_seckey_slice` after unconditional panic.
let ctx:Secp256k1<crate::SignOnlyPreallocated> = panic!("cannot deserialize key pair without a context (please enable either the global-context or alloc feature)");
0 commit comments