Skip to content

Commit ab9fdf0

Browse files
committed
Merge #510: Fix incorrect method call
cd7a6b3 Fix incorrect method call (Tobin C. Harding) Pull request description: 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, I have no idea why this code builds. (Also see #508.) ACKs for top commit: apoelstra: ACK cd7a6b3 Tree-SHA512: 5f22157798a4e4a21fff946dd930c62c7d82100a8e729309f6383709cb3fefdd935df1b7954fc545f1c2283a46b8c22f61e1c6d4534cb750eb7ab3b5036eedf5
2 parents 4ff168b + cd7a6b3 commit ab9fdf0

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)