Skip to content

Commit

Permalink
Merge pull request #611 from sgeisler/2021-06-fix-release
Browse files Browse the repository at this point in the history
Fix release 0.26.2
  • Loading branch information
apoelstra committed Jun 8, 2021
2 parents c82e758 + 055d0fb commit 9b20985
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
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.

# 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

0 comments on commit 9b20985

Please sign in to comment.