Merge rust-bitcoin/rust-secp256k1#530: secp256k1: Improve docs on `Error`

42bf99f11b Add full stop (Tobin C. Harding)
96f9fd3e56 Link to MESSAGE_SIZE in Error docs (Tobin C. Harding)
036bd0d011 secp256k1: Generalize docs on Error (Tobin C. Harding)

Pull request description:

  The docs on `Error` currently mention ECDSA which is no longer correct since we use this error in `schnorr` as well.

  Fix the `Error` doc issue described above and do a couple trivial other fixes while we are touching the code.

ACKs for top commit:
  apoelstra:
    ACK 42bf99f11b

Tree-SHA512: e1658d909c3588736570517a351e85c85c014ee31efe09fd262654dad873b0dcd3dbb6c8ad40866a24ee8e2e9bf0be99e5eb35251f6640222b953a0eb2a732ca
This commit is contained in:
Andrew Poelstra 2022-11-23 19:52:03 +00:00
commit fb45ae4de9
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 3 additions and 4 deletions

View File

@ -299,13 +299,12 @@ impl fmt::Display for Message {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) } fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
} }
/// An ECDSA error /// The main error type for this library.
#[derive(Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Debug)] #[derive(Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Debug)]
pub enum Error { pub enum Error {
/// Signature failed verification /// Signature failed verification.
IncorrectSignature, IncorrectSignature,
/// Badly sized message ("messages" are actually fixed-sized digests; see the `MESSAGE_SIZE` /// Bad sized message ("messages" are actually fixed-sized digests [`constants::MESSAGE_SIZE`]).
/// constant).
InvalidMessage, InvalidMessage,
/// Bad public key. /// Bad public key.
InvalidPublicKey, InvalidPublicKey,