We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a694b2c commit 0540116Copy full SHA for 0540116
src/key.rs
@@ -1718,6 +1718,31 @@ mod test {
1718
"0100000000000000020000000000000003000000000000000400000000000000"
1719
);
1720
}
1721
+ #[test]
1722
+ fn test_display_obfuscation() {
1723
+ #[rustfmt::skip]
1724
+ static SK_BYTES: [u8; 32] = [
1725
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
1726
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1727
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
1728
+ 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
1729
+ ];
1730
+
1731
+ let sk = SecretKey::from_slice(&SK_BYTES).expect("sk");
1732
1733
+ #[cfg(feature = "std")]
1734
+ {
1735
+ let got = format!("{:?}", sk);
1736
+ let want = "SecretKey(#2f4d520bd6874292)";
1737
+ assert_eq!(got, want);
1738
+ }
1739
+ #[cfg(all(not(feature = "std"), feature = "hashes"))]
1740
1741
1742
+ let want = "SecretKey(#de5a451f70110720)";
1743
1744
1745
1746
1747
#[test]
1748
#[cfg(feature = "alloc")]
0 commit comments