Skip to content

Commit

Permalink
chore: fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Mar 17, 2024
1 parent 40b0d02 commit d2193cc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
6 changes: 3 additions & 3 deletions psbt/src/proprietary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ pub enum ProprietaryKeyError {
/// parts:
/// 1) key location, in form of `input(no)`, `output(no)`, or `global`;
/// 2) key type, in form of `prefix(no)`;
/// 3) key-value pair, in form of `key:value`, where both key and value
/// must be hexadecimal bytestrings; one of them may be omitted
/// (for instance, `:value` or `key:`).
/// 3) key-value pair, in form of `key:value`, where both key and value must
/// be hexadecimal bytestrings; one of them may be omitted (for instance,
/// `:value` or `key:`).
///
/// If the proprietary key does not have associated data, the third part of
/// the descriptor must be fully omitted.
Expand Down
22 changes: 18 additions & 4 deletions src/bin/btc-expl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,33 @@ impl Args {
Some(WitnessVersion::V0) if prevout.script_pubkey.is_v0_p2wpkh() => {
let mut iter = txin.witness.iter();
let Some(sersig) = iter.next() else {
eprintln!(" {}", "invalid witness structure for P2WPK output".bright_red());
eprintln!(
" {}",
"invalid witness structure for P2WPK output".bright_red()
);
continue;
};
let Ok(sig) = EcdsaSig::from_slice(sersig) else {
eprintln!(" {} {}", "invalid signature".bright_red(), sersig.to_hex());
eprintln!(
" {} {}",
"invalid signature".bright_red(),
sersig.to_hex()
);
continue;
};
let Some(serpk) = iter.next() else {
eprintln!(" {}", "invalid witness structure for P2WPK output".bright_red());
eprintln!(
" {}",
"invalid witness structure for P2WPK output".bright_red()
);
continue;
};
let Ok(pk) = PublicKey::from_slice(serpk) else {
eprintln!(" {} {}", "invalid public key".bright_red(), serpk.to_hex());
eprintln!(
" {} {}",
"invalid public key".bright_red(),
serpk.to_hex()
);
continue;
};
println!(" wpkh({pk})");
Expand Down

0 comments on commit d2193cc

Please sign in to comment.