rust-bitcoin-unsafe-fast/bitcoin/src
Riccardo Casatta 28f6ad80cb
Merge rust-bitcoin/rust-bitcoin#1942: witness: clean up Debug implementation
e30c492faf witness: clean up Debug implementation (Andrew Poelstra)

Pull request description:

  The previous code seems to have been rebased/iterated on too many times, and had room for significant simplification. By inlining the indentation logic we can eliminate 40 LOC and also clean up the output by removing trailing spaces.

  Fixes #1937

  It is not good form to add unit tests for debug output but you can test this locally with the patch
  ```
  diff --git a/bitcoin/src/blockdata/witness.rs b/bitcoin/src/blockdata/witness.rs
  index d0b7408c..a2c38af0 100644
  --- a/bitcoin/src/blockdata/witness.rs
  +++ b/bitcoin/src/blockdata/witness.rs
  @@ -619,6 +619,9 @@ mod test {
               "304402207c800d698f4b0298c5aac830b822f011bb02df41eb114ade9a6702f364d5e39c0220366900d2a60cab903e77ef7dd415d46509b1f78ac78906e3296f495aa1b1b54101")
               ];
           assert_eq!(witness.to_vec(), expected_witness);
  +
  +            println!("{:?}", witness);
  +            panic!();
       }

       #[test]
  ```
  And by sticking `{:#?}` in there to see the alternate output.

ACKs for top commit:
  tcharding:
    tACK e30c492faf
  RCasatta:
    ACK e30c492faf

Tree-SHA512: 0ec07885f5c75f3f34965852cf5b42b63290295d1f56e9fef7d5b3610b8ac8d318cbf8f184da5b8a9ed5b352bb2c0402797b41714cb9d5488e93c2e290340c2a
2023-07-18 20:18:04 +02:00
..
blockdata Merge rust-bitcoin/rust-bitcoin#1942: witness: clean up Debug implementation 2023-07-18 20:18:04 +02:00
consensus Remove doc(hidden) from error conversion functions 2023-05-30 15:54:40 +10:00
crypto Rename Script::empty to Script::new 2023-07-08 11:26:30 +10:00
merkle_tree Merge rust-bitcoin/rust-bitcoin#1825: Simplify per-file license comments 2023-05-01 20:11:53 +00:00
network network: Implement Default on ServiceFlags 2023-06-06 00:06:28 +01:00
psbt Merge rust-bitcoin/rust-bitcoin#1938: Rename PartiallySignedTransaction to Psbt 2023-07-17 16:35:43 +00:00
util bitcoin: Remove attribution from all files 2023-05-01 09:22:48 +10:00
address.rs Move witness types to the script module 2023-07-13 09:51:40 +10:00
amount.rs Use from_int_btc function for const context 2023-06-13 11:32:58 +02:00
base58.rs bitcoin: Remove attribution from all files 2023-05-01 09:22:48 +10:00
bip32.rs Remove docsrs attributes 2023-07-14 14:59:11 +10:00
bip152.rs Use Amount type for TxOut value field 2023-05-04 17:09:08 +02:00
bip158.rs bitcoin: Remove attribution from all files 2023-05-01 09:22:48 +10:00
error.rs Move `impl_std_error` to `bitcoin-internals` 2023-05-30 18:04:54 +02:00
hash_types.rs bitcoin: Remove attribution from all files 2023-05-01 09:22:48 +10:00
internal_macros.rs bitcoin: Remove attribution from all files 2023-05-01 09:22:48 +10:00
lib.rs Merge rust-bitcoin/rust-bitcoin#1938: Rename PartiallySignedTransaction to Psbt 2023-07-17 16:35:43 +00:00
parse.rs bitcoin: Remove attribution from all files 2023-05-01 09:22:48 +10:00
policy.rs bitcoin: Remove attribution from all files 2023-05-01 09:22:48 +10:00
pow.rs Merge rust-bitcoin/rust-bitcoin#1739: Mutate mul_u64 with mutagen 2023-06-14 17:53:39 -07:00
serde_utils.rs Use package in manifest and shorten import 2023-03-28 12:20:04 +11:00
sign_message.rs Remove doc(hidden) from error conversion functions 2023-05-30 15:54:40 +10:00
string.rs Merge rust-bitcoin/rust-bitcoin#1742: Use package in manifest and shorten import 2023-04-05 14:20:06 +00:00
taproot.rs Merge rust-bitcoin/rust-bitcoin#1895: Improve `crytpo::taproot` error type 2023-06-04 21:22:21 +00:00
test_macros.rs bitcoin: Remove attribution from all files 2023-05-01 09:22:48 +10:00