Merge rust-bitcoin/rust-bitcoin#3950: Use MAX_MONEY in serde regression test

4dad4730a8 Add unreleased changelog entry (Tobin C. Harding)
08bb57e499 Use MAX_MONEY in serde regression test (Tobin C. Harding)

Pull request description:

  We plan on enforcing MAX_MONEY in the amount types. In preparation use MAX_MONEY in the serde regression test instead of the arbitrary, and too large DEADBEEFCAFEBABE value.

ACKs for top commit:
  apoelstra:
    ACK 4dad4730a81f9f08a565f196e5699f054e28f977; successfully ran local tests

Tree-SHA512: 10fefdb75289f4c93537e031410eb729420729563b262d6104948a0176a78c4f6130956b550cc08ffc924b1bce1c42f0544542879a4d44165022196ef695718a
This commit is contained in:
merge-script 2025-01-26 14:54:13 +00:00
commit 2f09da8e47
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
4 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,9 @@
# Unreleased
- TODO: Make a comment about `Amount::MAX_MONEY` (perhaps here in `bitcoin` release notes as well as in `amount`)
- Use MAX_MONEY in serde regression test [#3950](https://github.com/rust-bitcoin/rust-bitcoin/pull/3950)
# 0.33.0-alpha.0 - 2024-11-18 # 0.33.0-alpha.0 - 2024-11-18
This series of alpha releases is meant for two things: This series of alpha releases is meant for two things:

View File

@ -109,10 +109,8 @@ fn serde_regression_txin() {
#[test] #[test]
fn serde_regression_txout() { fn serde_regression_txout() {
let txout = TxOut { let txout =
value: Amount::from_sat(0xDEADBEEFCAFEBABE), TxOut { value: Amount::MAX_MONEY, script_pubkey: ScriptBuf::from(vec![0u8, 1u8, 2u8]) };
script_pubkey: ScriptBuf::from(vec![0u8, 1u8, 2u8]),
};
let got = serialize(&txout).unwrap(); let got = serialize(&txout).unwrap();
let want = include_bytes!("data/serde/txout_bincode") as &[_]; let want = include_bytes!("data/serde/txout_bincode") as &[_];
assert_eq!(got, want) assert_eq!(got, want)

View File

@ -1,3 +1,9 @@
# Unreleased
- TODO: Make a comment about `Amount::MAX_MONEY` including breaking serde
- Use MAX_MONEY in serde regression test [#3950](https://github.com/rust-bitcoin/rust-bitcoin/pull/3950)
# 0.2.0 - 2024-09-18 # 0.2.0 - 2024-09-18
* Bump MSRV to 1.63.0 [#3100](https://github.com/rust-bitcoin/rust-bitcoin/pull/3100) * Bump MSRV to 1.63.0 [#3100](https://github.com/rust-bitcoin/rust-bitcoin/pull/3100)