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

to_string_no_chksum is broken #34

Open
apoelstra opened this issue Oct 17, 2022 · 0 comments · May be fixed by #86
Open

to_string_no_chksum is broken #34

apoelstra opened this issue Oct 17, 2022 · 0 comments · May be 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 to apoelstra/elements-miniscript that referenced this issue Jun 15, 2024
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 ElementsProject#34
Fixes ElementsProject#85
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