rust-bitcoin-unsafe-fast/src
Andrew Poelstra cd790dc7e9
Merge rust-bitcoin/rust-bitcoin#1068: Implement human-readable serde for `Witness`
a1df62a3d9 Witness human-readable serde test (Dr Maxim Orlovsky)
68577dfb50 Witness human-readable serde (Dr Maxim Orlovsky)
93b66c55b3 Witness serde: test binary encoding to be backward-compatible (Dr Maxim Orlovsky)
b409ae78a4 witness: Refactor import statements (Tobin C. Harding)
e23d3a815c Remove unnecessary whitespace (Tobin C. Harding)
ac55b1017e Add whitespace between functions (Tobin C. Harding)

Pull request description:

  This is dr-orlovsky's [PR](https://github.com/rust-bitcoin/rust-bitcoin/pull/899) picked up at his permission in the discussion thread.

  I went through the review comments and implemented everything except the perf optimisations. Also includes a patch at the front of the PR that adds a unit test that can be run to see the "before and after", not sure if we want it in, perhaps it should be removed before merge.

  This PR implicitly fixes 942.

  To test this PR works as advertised run `cargo test display_transaction --features=serde -- --nocapture` after creating a unit test as follows:
  ```rust

      // Used to verify that parts of a transaction pretty print.
      // `cargo test display_transaction --features=serde -- --nocapture`
      #[cfg(feature = "serde")]
      #[test]
      fn serde_display_transaction() {
          let tx_bytes = Vec::from_hex(
              "02000000000101595895ea20179de87052b4046dfe6fd515860505d6511a9004cf12a1f93cac7c01000000\
              00ffffffff01deb807000000000017a9140f3444e271620c736808aa7b33e370bd87cb5a078702483045022\
              100fb60dad8df4af2841adc0346638c16d0b8035f5e3f3753b88db122e70c79f9370220756e6633b17fd271\
              0e626347d28d60b0a2d6cbb41de51740644b9fb3ba7751040121028fa937ca8cba2197a37c007176ed89410\
              55d3bcb8627d085e94553e62f057dcc00000000"
          ).unwrap();
          let tx: Transaction = deserialize(&tx_bytes).unwrap();
          let ser = serde_json::to_string_pretty(&tx).unwrap();
          println!("{}", ser);
      }
  ```

  Fixes: #942

ACKs for top commit:
  apoelstra:
    ACK a1df62a3d9
  Kixunil:
    ACK a1df62a3d9

Tree-SHA512: d0ef5b8cbf1cf8456eaaea490a793f1ac7dfb18067c4019a2c3a1bdd9627a231a4dd0a0151a4df9af2b32b909d4b384a5bec1dd3e38d44dc6a23f9c40aa4f1f9
2022-07-18 19:06:39 +00:00
..
blockdata Merge rust-bitcoin/rust-bitcoin#1068: Implement human-readable serde for `Witness` 2022-07-18 19:06:39 +00:00
consensus Merge rust-bitcoin/rust-bitcoin#1066: Upgrade to secp256k1 v0.23.0 2022-07-12 14:03:49 +00:00
network Upgrade to bitcoin_hashes v0.11.0 2022-07-13 09:38:05 +10:00
util Merge rust-bitcoin/rust-bitcoin#1093: Add new type for sequence 2022-07-17 23:04:16 +00:00
hash_types.rs Upgrade to bitcoin_hashes v0.11.0 2022-07-13 09:38:05 +10:00
internal_macros.rs Merge rust-bitcoin/rust-bitcoin#1076: Introduce SPDX license identifiers 2022-07-11 15:11:03 +00:00
lib.rs Merge rust-bitcoin/rust-bitcoin#1093: Add new type for sequence 2022-07-17 23:04:16 +00:00
policy.rs Introduce SPDX license identifiers 2022-06-29 14:12:02 +10:00
serde_utils.rs Introduce SPDX license identifiers 2022-06-29 14:12:02 +10:00
test_macros.rs Introduce SPDX license identifiers 2022-06-29 14:12:02 +10:00