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
let ctx:Secp256k1<crate::SignOnlyPreallocated> = panic!("The previous implementation was panicking too, please enable the global-context feature of rust-secp256k1");
1068
+
1069
+
#[allow(clippy::needless_borrow)]
1063
1070
KeyPair::from_seckey_str(&ctx, s)
1064
1071
}
1065
1072
}
@@ -1093,8 +1100,17 @@ impl<'de> serde::Deserialize<'de> for KeyPair {
1093
1100
}else{
1094
1101
let visitor = super::serde_util::Tuple32Visitor::new(
1095
1102
"raw 32 bytes KeyPair",
1096
-
|data| unsafe{
1097
-
let ctx = Secp256k1::from_raw_all(ffi::secp256k1_context_no_precomp as*mut ffi::Context);
let ctx:Secp256k1<crate::SignOnlyPreallocated> = panic!("The previous implementation was panicking too, please enable the global-context feature of rust-secp256k1");
1112
+
1113
+
#[allow(clippy::needless_borrow)]
1098
1114
KeyPair::from_seckey_slice(&ctx, data)
1099
1115
}
1100
1116
);
@@ -1630,12 +1646,14 @@ pub mod serde_keypair {
1630
1646
#[cfg(test)]
1631
1647
#[allow(unused_imports)]
1632
1648
mod test {
1649
+
use bitcoin_hashes::hex::ToHex;
1633
1650
usesuper::*;
1634
1651
1635
1652
use core::str::FromStr;
1636
1653
1637
1654
#[cfg(any(feature = "alloc", feature = "std"))]
1638
1655
use rand::{Error,RngCore, thread_rng, rngs::mock::StepRng};
0 commit comments