Skip to content

Commit cd7a6b3

Browse files
committed
Fix incorrect method call
We have the following method on `SecretKey` ``` pub fn sign_ecdsa(&self, msg: Message) -> ecdsa::Signature { SECP256K1.sign_ecdsa(&msg, self) } ``` But we have a method call in rustdocs ``` //! let (secret_key, public_key) = generate_keypair(&mut thread_rng()); //! let message = Message::from_hashed_data::<sha256::Hash>("Hello World!".as_bytes()); //! //! let sig = secret_key.sign_ecdsa(&message, &secret_key); ``` This is incorrect and is currently not running because the feature guard is incorrectly spelled, it contains the word "features" instead of "feature".
1 parent 5a54694 commit cd7a6b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@
5858
//! If the "global-context" feature is enabled you have access to an alternate API.
5959
//!
6060
//! ```rust
61-
//! # #[cfg(all(feature="global-context", feature = "std", feature="rand-std", features = "bitcoin-hashes-std"))] {
61+
//! # #[cfg(all(feature = "global-context", feature = "std", feature = "rand-std", feature = "bitcoin-hashes-std"))] {
6262
//! use secp256k1::rand::thread_rng;
6363
//! use secp256k1::{generate_keypair, Message};
6464
//! use secp256k1::hashes::sha256;
6565
//!
6666
//! let (secret_key, public_key) = generate_keypair(&mut thread_rng());
6767
//! let message = Message::from_hashed_data::<sha256::Hash>("Hello World!".as_bytes());
6868
//!
69-
//! let sig = secret_key.sign_ecdsa(&message, &secret_key);
69+
//! let sig = secret_key.sign_ecdsa(message);
7070
//! assert!(sig.verify(&message, &public_key).is_ok());
7171
//! # }
7272
//! ```

0 commit comments

Comments
 (0)