Do not capitalize error messages

As per convention; do not capitalize error messages.
This commit is contained in:
Tobin C. Harding 2023-05-18 15:38:19 +10:00
parent ae07786c27
commit f23155aa16
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
3 changed files with 12 additions and 12 deletions

View File

@ -1792,7 +1792,7 @@ mod tests {
for s in sht_mistakes { for s in sht_mistakes {
assert_eq!( assert_eq!(
EcdsaSighashType::from_str(s).unwrap_err().to_string(), EcdsaSighashType::from_str(s).unwrap_err().to_string(),
format!("Unrecognized SIGHASH string '{}'", s) format!("unrecognized SIGHASH string '{}'", s)
); );
} }
} }

View File

@ -49,7 +49,7 @@ impl fmt::Display for Error {
InvalidKeyPrefix(ref b) => write!(f, "key prefix invalid: {}", b), InvalidKeyPrefix(ref b) => write!(f, "key prefix invalid: {}", b),
Hex(ref e) => write_err!(f, "key hex decoding error"; e), Hex(ref e) => write_err!(f, "key hex decoding error"; e),
InvalidHexLength(got) => InvalidHexLength(got) =>
write!(f, "PublicKey hex should be 66 or 130 digits long, got: {}", got), write!(f, "pubkey hex should be 66 or 130 digits long, got: {}", got),
} }
} }
} }

View File

@ -248,12 +248,12 @@ impl fmt::Display for Error {
match self { match self {
Io(error_kind) => write!(f, "writer errored: {:?}", error_kind), Io(error_kind) => write!(f, "writer errored: {:?}", error_kind),
IndexOutOfInputsBounds { index, inputs_size } => write!(f, "Requested index ({}) is greater or equal than the number of transaction inputs ({})", index, inputs_size), IndexOutOfInputsBounds { index, inputs_size } => write!(f, "requested index ({}) is greater or equal than the number of transaction inputs ({})", index, inputs_size),
SingleWithoutCorrespondingOutput { index, outputs_size } => write!(f, "SIGHASH_SINGLE for input ({}) haven't a corresponding output (#outputs:{})", index, outputs_size), SingleWithoutCorrespondingOutput { index, outputs_size } => write!(f, "SIGHASH_SINGLE for input ({}) haven't a corresponding output (#outputs:{})", index, outputs_size),
PrevoutsSize => write!(f, "Number of supplied prevouts differs from the number of inputs in transaction"), PrevoutsSize => write!(f, "number of supplied prevouts differs from the number of inputs in transaction"),
PrevoutIndex => write!(f, "The index requested is greater than available prevouts or different from the provided [Provided::Anyone] index"), PrevoutIndex => write!(f, "the index requested is greater than available prevouts or different from the provided [Provided::Anyone] index"),
PrevoutKind => write!(f, "A single prevout has been provided but all prevouts are needed without `ANYONECANPAY`"), PrevoutKind => write!(f, "a single prevout has been provided but all prevouts are needed without `ANYONECANPAY`"),
WrongAnnex => write!(f, "Annex must be at least one byte long and the first bytes must be `0x50`"), WrongAnnex => write!(f, "annex must be at least one byte long and the first bytes must be `0x50`"),
InvalidSighashType(hash_ty) => write!(f, "Invalid taproot signature hash type : {} ", hash_ty), InvalidSighashType(hash_ty) => write!(f, "Invalid taproot signature hash type : {} ", hash_ty),
} }
} }
@ -325,8 +325,8 @@ impl<'s> ScriptPath<'s> {
self.leaf_version self.leaf_version
.to_consensus() .to_consensus()
.consensus_encode(&mut enc) .consensus_encode(&mut enc)
.expect("Writing to hash enging should never fail"); .expect("writing to hash enging should never fail");
self.script.consensus_encode(&mut enc).expect("Writing to hash enging should never fail"); self.script.consensus_encode(&mut enc).expect("writing to hash enging should never fail");
TapLeafHash::from_engine(enc) TapLeafHash::from_engine(enc)
} }
@ -534,7 +534,7 @@ pub struct NonStandardSighashTypeError(pub u32);
impl fmt::Display for NonStandardSighashTypeError { impl fmt::Display for NonStandardSighashTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Non standard sighash type {}", self.0) write!(f, "non-standard sighash type {}", self.0)
} }
} }
@ -551,7 +551,7 @@ pub struct SighashTypeParseError {
impl fmt::Display for SighashTypeParseError { impl fmt::Display for SighashTypeParseError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Unrecognized SIGHASH string '{}'", self.unrecognized) write!(f, "unrecognized SIGHASH string '{}'", self.unrecognized)
} }
} }
@ -1666,7 +1666,7 @@ mod tests {
for s in sht_mistakes { for s in sht_mistakes {
assert_eq!( assert_eq!(
TapSighashType::from_str(s).unwrap_err().to_string(), TapSighashType::from_str(s).unwrap_err().to_string(),
format!("Unrecognized SIGHASH string '{}'", s) format!("unrecognized SIGHASH string '{}'", s)
); );
} }
} }