From f11f09d55b7612cf1fe05c0c72a6259f376a3e57 Mon Sep 17 00:00:00 2001 From: Alekos Filini Date: Tue, 8 Jun 2021 14:00:15 +0200 Subject: [PATCH 1/3] Fix release date in the changelog for `0.26.1` --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6460b531..da16e3f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ -# 0.26.1 - 2020-06-06 +# 0.26.1 - 2021-06-06 - [Change Amount Debug impl to BTC with 8 decimals](https://github.com/rust-bitcoin/rust-bitcoin/pull/414) - [Make uint types (un)serializable](https://github.com/rust-bitcoin/rust-bitcoin/pull/511) From 091ac8944081bf0df4904c6b36fa5d93af0c6cc5 Mon Sep 17 00:00:00 2001 From: Sebastian Geisler Date: Tue, 8 Jun 2021 15:19:01 +0200 Subject: [PATCH 2/3] Fix semver breaking Display change of ChildNumber Fixes #608. In #567 the Display impl for ChildNumber was consciously changed, assuming the semver break would not affect any correctly implemented downstream projects. We were wrong. --- src/util/bip32.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util/bip32.rs b/src/util/bip32.rs index c45ec1a6..8f7b91c0 100644 --- a/src/util/bip32.rs +++ b/src/util/bip32.rs @@ -172,7 +172,7 @@ impl fmt::Display for ChildNumber { ChildNumber::Hardened { index } => { fmt::Display::fmt(&index, f)?; let alt = f.alternate(); - f.write_str(if alt { "'" } else { "h" }) + f.write_str(if alt { "h" } else { "'" }) }, ChildNumber::Normal { index } => fmt::Display::fmt(&index, f), } @@ -1070,10 +1070,10 @@ mod tests { #[test] fn fmt_child_number() { - assert_eq!("000005'", &format!("{:#06}", ChildNumber::from_hardened_idx(5).unwrap())); - assert_eq!("5'", &format!("{:#}", ChildNumber::from_hardened_idx(5).unwrap())); - assert_eq!("000005h", &format!("{:06}", ChildNumber::from_hardened_idx(5).unwrap())); - assert_eq!("5h", &format!("{}", ChildNumber::from_hardened_idx(5).unwrap())); + assert_eq!("000005h", &format!("{:#06}", ChildNumber::from_hardened_idx(5).unwrap())); + assert_eq!("5h", &format!("{:#}", ChildNumber::from_hardened_idx(5).unwrap())); + assert_eq!("000005'", &format!("{:06}", ChildNumber::from_hardened_idx(5).unwrap())); + assert_eq!("5'", &format!("{}", ChildNumber::from_hardened_idx(5).unwrap())); assert_eq!("42", &format!("{}", ChildNumber::from_normal_idx(42).unwrap())); assert_eq!("000042", &format!("{:06}", ChildNumber::from_normal_idx(42).unwrap())); } From 055d0fb08740a622fec89e0afb3896c79bb6fbeb Mon Sep 17 00:00:00 2001 From: Sebastian Geisler Date: Tue, 8 Jun 2021 15:27:16 +0200 Subject: [PATCH 3/3] Prepare release 0.26.2 --- CHANGELOG.md | 10 +++++++++- Cargo.toml | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da16e3f1..036a035b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ -# 0.26.1 - 2021-06-06 +# 0.26.2 - 2021-06-08 + +- [Fix `Display` impl of `ChildNumber`](https://github.com/rust-bitcoin/rust-bitcoin/pull/611) + +The previous release changed the behavior of `Display` for `ChildNumber`, assuming that any correct usage would not be +affected. [Issue 608](https://github.com/rust-bitcoin/rust-bitcoin/issues/608) goes into the details of why this isn't +the case and how we broke both `rust-miniscript` and BDK. + +# 0.26.1 - 2021-06-06 (yanked, see explanation above) - [Change Amount Debug impl to BTC with 8 decimals](https://github.com/rust-bitcoin/rust-bitcoin/pull/414) - [Make uint types (un)serializable](https://github.com/rust-bitcoin/rust-bitcoin/pull/511) diff --git a/Cargo.toml b/Cargo.toml index 533560e7..0f1ee955 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bitcoin" -version = "0.26.1" +version = "0.26.2" authors = ["Andrew Poelstra "] license = "CC0-1.0" homepage = "https://github.com/rust-bitcoin/rust-bitcoin/"