Skip to content

Commit f77fa62

Browse files
committed
Merge #86: descriptor: drop to_string_no_chksum method
e28d6d4 descriptor: drop `to_string_no_chksum` method (Andrew Poelstra) Pull request description: This method has been made redundant by the `{:#}` display specifier since 7577e8c two years ago. It is poorly named, inefficient since it always requires allocating a `String`, and also broken because it uses debug display for keys. All of our unit tests were converted over to use :# which is why it wasn't noticed that this method didn't work. Fixes #34 Fixes #85 ACKs for top commit: delta1: ACK e28d6d4 RCasatta: utACK e28d6d4 Tree-SHA512: 73ee261979822906316fac727970ccdb723bee400a9bba789d68b4851b8bf9b2d500dd5c9a22d75b9c43bcfc57e8d1701c83d43f420edcb257e51653ae314744
2 parents 090ce14 + e28d6d4 commit f77fa62

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Unreleased
2+
3+
- [Removed `to_string_no_chksum`](https://github.com/ElementsProject/elements-miniscript/pull/86). This method was poorly-named and broken. Use the alternate display `{:#}` formatter instead to format descriptors without a checksum.
4+
15
# 0.3.1 - May 10, 2024
26

37
- [Fixed](https://github.com/ElementsProject/elements-miniscript/pull/81) ELIP-151 hash calculation

src/descriptor/csfs_cov/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ mod tests {
8484

8585
fn string_rtt(desc_str: &str) {
8686
let desc = Descriptor::<String>::from_str(desc_str).unwrap();
87-
assert_eq!(desc.to_string_no_chksum(), desc_str);
87+
assert_eq!(format!("{:#}", desc), desc_str);
8888
let cov_desc = desc.as_cov().unwrap();
8989
assert_eq!(cov_desc.to_string(), desc.to_string());
9090
}

src/descriptor/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,6 @@ impl<Pk: MiniscriptKey, Ext: Extension> Descriptor<Pk, Ext> {
434434
}
435435
}
436436

437-
/// Return a string without the checksum
438-
pub fn to_string_no_chksum(&self) -> String {
439-
format!("{:?}", self)
440-
}
441437
/// Checks whether the descriptor is safe.
442438
///
443439
/// Checks whether all the spend paths in the descriptor are possible on the

0 commit comments

Comments
 (0)