Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix release 0.26.2 #611

Merged
merged 3 commits into from Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
@@ -1,5 +1,13 @@

# 0.26.1 - 2020-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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a trailing space here, but I'll let it go.


# 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)
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "bitcoin"
version = "0.26.1"
version = "0.26.2"
authors = ["Andrew Poelstra <apoelstra@wpsoftware.net>"]
license = "CC0-1.0"
homepage = "https://github.com/rust-bitcoin/rust-bitcoin/"
Expand Down
10 changes: 5 additions & 5 deletions src/util/bip32.rs
Expand Up @@ -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),
}
Expand Down Expand Up @@ -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()));
}
Expand Down