Make capitalization of SegWit uniform in strings

This commit is contained in:
Jamil Lambert, PhD 2024-12-17 14:29:42 +00:00
parent 3520e832ac
commit e56f461916
No known key found for this signature in database
GPG Key ID: 54DC29234AB5D2C0
6 changed files with 7 additions and 7 deletions

View File

@ -45,7 +45,7 @@ fn compute_sighash_p2wpkh(raw_tx: &[u8], inp_idx: usize, value: u64) {
let sighash = cache let sighash = cache
.p2wpkh_signature_hash(inp_idx, &spk, Amount::from_sat(value), sig.sighash_type) .p2wpkh_signature_hash(inp_idx, &spk, Amount::from_sat(value), sig.sighash_type)
.expect("failed to compute sighash"); .expect("failed to compute sighash");
println!("Segwit p2wpkh sighash: {:x}", sighash); println!("SegWit p2wpkh sighash: {:x}", sighash);
let msg = secp256k1::Message::from(sighash); let msg = secp256k1::Message::from(sighash);
println!("Message is {:x}", msg); println!("Message is {:x}", msg);
let secp = secp256k1::Secp256k1::verification_only(); let secp = secp256k1::Secp256k1::verification_only();
@ -132,7 +132,7 @@ fn compute_sighash_p2wsh(raw_tx: &[u8], inp_idx: usize, value: u64) {
sig.sighash_type, sig.sighash_type,
) )
.expect("failed to compute sighash"); .expect("failed to compute sighash");
println!("Segwit p2wsh sighash: {:x} ({})", sighash, sig.sighash_type); println!("SegWit p2wsh sighash: {:x} ({})", sighash, sig.sighash_type);
} }
} }

View File

@ -182,7 +182,7 @@ impl fmt::Display for Bech32Error {
use Bech32Error::*; use Bech32Error::*;
match *self { match *self {
ParseBech32(ref e) => write_err!(f, "segwit parsing error"; e), ParseBech32(ref e) => write_err!(f, "SegWit parsing error"; e),
WitnessVersion(ref e) => write_err!(f, "witness version conversion/parsing error"; e), WitnessVersion(ref e) => write_err!(f, "witness version conversion/parsing error"; e),
WitnessProgram(ref e) => write_err!(f, "witness program error"; e), WitnessProgram(ref e) => write_err!(f, "witness program error"; e),
UnknownHrp(ref e) => write_err!(f, "unknown hrp error"; e), UnknownHrp(ref e) => write_err!(f, "unknown hrp error"; e),

View File

@ -184,7 +184,7 @@ impl fmt::Display for ParseError {
NonMinimalVarInt => write!(f, "non-minimal varint"), NonMinimalVarInt => write!(f, "non-minimal varint"),
ParseFailed(ref s) => write!(f, "parse failed: {}", s), ParseFailed(ref s) => write!(f, "parse failed: {}", s),
UnsupportedSegwitFlag(ref swflag) => UnsupportedSegwitFlag(ref swflag) =>
write!(f, "unsupported segwit version: {}", swflag), write!(f, "unsupported SegWit version: {}", swflag),
} }
} }
} }

View File

@ -1100,7 +1100,7 @@ pub struct UncompressedPublicKeyError;
impl fmt::Display for UncompressedPublicKeyError { impl fmt::Display for UncompressedPublicKeyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("segwit public keys must always be compressed") f.write_str("SegWit public keys must always be compressed")
} }
} }

View File

@ -1273,7 +1273,7 @@ impl fmt::Display for P2wpkhError {
use P2wpkhError::*; use P2wpkhError::*;
match *self { match *self {
Sighash(ref e) => write_err!(f, "error encoding segwit v0 signing data"; e), Sighash(ref e) => write_err!(f, "error encoding SegWit v0 signing data"; e),
NotP2wpkhScript => write!(f, "script is not a script pubkey for a p2wpkh output"), NotP2wpkhScript => write!(f, "script is not a script pubkey for a p2wpkh output"),
} }
} }

View File

@ -986,7 +986,7 @@ impl fmt::Display for SignError {
MismatchedAlgoKey => write!(f, "signing algorithm and key type does not match"), MismatchedAlgoKey => write!(f, "signing algorithm and key type does not match"),
NotEcdsa => write!(f, "attempted to ECDSA sign an non-ECDSA input"), NotEcdsa => write!(f, "attempted to ECDSA sign an non-ECDSA input"),
NotWpkh => write!(f, "the scriptPubkey is not a P2WPKH script"), NotWpkh => write!(f, "the scriptPubkey is not a P2WPKH script"),
SegwitV0Sighash(ref e) => write_err!(f, "segwit v0 sighash"; e), SegwitV0Sighash(ref e) => write_err!(f, "SegWit v0 sighash"; e),
P2wpkhSighash(ref e) => write_err!(f, "p2wpkh sighash"; e), P2wpkhSighash(ref e) => write_err!(f, "p2wpkh sighash"; e),
TaprootError(ref e) => write_err!(f, "Taproot sighash"; e), TaprootError(ref e) => write_err!(f, "Taproot sighash"; e),
UnknownOutputType => write!(f, "unable to determine the output type"), UnknownOutputType => write!(f, "unable to determine the output type"),