rust-bitcoin-unsafe-fast/bitcoin/tests/data/serde
Tobin C. Harding 4621d2bde1
Modify locktime serde implemenations
The `units::locktime` types are used for two things:

- They are the inner types of `primitives` `LockTime`s
- They are used ephemerally for checking satisfaction

Neither of these use cases requires `serde` impls for the `units` types.
Since we are trying to release 1.0 with minimal amounts of code we
should remove them.

For `LockTime`s that need to be stored on disk or go over the wire we
can manually implement the `serde` traits. For `absolute::LockTime` this
is done already and there is no reason the `relative::LockTime` impl
cannot be the same [0]. This differs from the current `serde` trait impls
but we have already decided that in 0.33 we are going to accept breakage
and direct users to use 0.32 to handle it.

- Remove `serde` stuff from `units::locktime`
- Manually implement `serde` traits on `relative::LockTime`
- Fix the regression test to use the new format

While we are at it use a uniform terse call in `serialize`.

[0] This is because there is an unambiguous encoding for the whole set
of locktimes - consensus encoding.
2025-06-01 14:07:33 +01:00
..
README.md chore: format and standardize all markdowns files 2024-04-27 06:29:23 -03:00
absolute_lock_time_blocks_bincode locktime: unify serde impls 2022-12-11 18:48:56 +00:00
absolute_lock_time_seconds_bincode locktime: unify serde impls 2022-12-11 18:48:56 +00:00
address_bincode Add serde regression tests 2022-10-29 10:47:16 +11:00
block_bincode Add serde regression tests 2022-10-29 10:47:16 +11:00
child_number_bincode Add serde regression tests 2022-10-29 10:47:16 +11:00
control_block_bincode Add serde regression tests 2022-10-29 10:47:16 +11:00
control_block_hex Add serde regression tests 2022-10-29 10:47:16 +11:00
ecdsa_sig_bincode Add serde regression tests 2022-10-29 10:47:16 +11:00
ecdsa_sig_hex Add serde regression tests 2022-10-29 10:47:16 +11:00
extended_priv_key Add serde regression tests 2022-10-29 10:47:16 +11:00
extended_priv_key_bincode Add serde regression tests 2022-10-29 10:47:16 +11:00
extended_pub_key Add serde regression tests 2022-10-29 10:47:16 +11:00
extended_pub_key_bincode Add serde regression tests 2022-10-29 10:47:16 +11:00
private_key_bincode Add serde regression tests 2022-10-29 10:47:16 +11:00
psbt_base64.json BREAKING: Change Psbt serde implementations 2025-05-22 16:41:05 -05:00
psbt_bincode BREAKING: Change Psbt serde implementations 2025-05-22 16:41:05 -05:00
public_key_bincode Add serde regression tests 2022-10-29 10:47:16 +11:00
public_key_hex Add serde regression tests 2022-10-29 10:47:16 +11:00
relative_lock_time_blocks_bincode Modify locktime serde implemenations 2025-06-01 14:07:33 +01:00
relative_lock_time_seconds_bincode Modify locktime serde implemenations 2025-06-01 14:07:33 +01:00
script_bincode Add serde regression tests 2022-10-29 10:47:16 +11:00
taproot_sig_bincode Rename schnorr module to taproot 2023-02-20 12:58:09 +11:00
taproot_sig_hex Rename schnorr module to taproot 2023-02-20 12:58:09 +11:00
taptree_bincode Introduce Hidden leaves in ScriptLeaves 2023-03-01 16:58:24 -08:00
transaction_bincode Add serde regression tests 2022-10-29 10:47:16 +11:00
transaction_ser Add serde regression tests 2022-10-29 10:47:16 +11:00
txin_bincode Add serde regression tests 2022-10-29 10:47:16 +11:00
txin_ser Add serde regression tests 2022-10-29 10:47:16 +11:00
txout_bincode Use MAX_MONEY in serde regression test 2025-01-24 12:15:13 +11:00
u256_bincode Add serde regression tests 2022-10-29 10:47:16 +11:00
uint128_bincode Add serde regression tests 2022-10-29 10:47:16 +11:00
uint256_bincode Add serde regression tests 2022-10-29 10:47:16 +11:00
witness_bincode Add serde regression tests 2022-10-29 10:47:16 +11:00

README.md

Serialization input/output

Files here contain hex strings and binary data representing types used for regression testing.

  • *_hex: consensus encoded types represented as hex strings
  • *_ser: consensus encoded types represented as binary data
  • *_bincode: types serialized with serde as bincode

We consensus deserialize, serde serialize, then check against the expected data to verify no serde regressions have been introduced.