Skip to content

to_string_no_chksum is broken #34

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

Closed
apoelstra opened this issue Oct 17, 2022 · 0 comments · Fixed by #86
Closed

to_string_no_chksum is broken #34

apoelstra opened this issue Oct 17, 2022 · 0 comments · Fixed by #86

Comments

@apoelstra
Copy link
Member

Rather than returning a String this should really use the alternate flag on a Formatter, for efficiency reasons. But regardless of efficiency, currently this function just calls Debug instead of Display which does not do the right thing. In particular the "no checksum" output wraps public keys in PublicKey(...).

cc rust-bitcoin/rust-miniscript#477

apoelstra added a commit that referenced this issue Sep 24, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant