allow disabling the checksum with alternate Display#478
Merged
sanket1729 merged 3 commits intorust-bitcoin:masterfrom Oct 18, 2022
Merged
allow disabling the checksum with alternate Display#478sanket1729 merged 3 commits intorust-bitcoin:masterfrom
Display#478sanket1729 merged 3 commits intorust-bitcoin:masterfrom
Conversation
This will let us avoid some allocations when formatting descriptors, and make it simpler to selectively append a checksum.
This allows us to remove the checksum with {:#}, and avoid extra
allocations in all cases. Deprecates the old to_string_no_checksum()
methods, which were inefficient and (in the case of Taproot) not
even exported.
Fixes rust-bitcoin#477
sanket1729
approved these changes
Oct 18, 2022
Member
sanket1729
left a comment
There was a problem hiding this comment.
ACK 7f5bbdf. The nit is just a stylistic comment.
| impl<'f, 'a> fmt::Write for Formatter<'f, 'a> { | ||
| fn write_str(&mut self, s: &str) -> fmt::Result { | ||
| self.fmt.write_str(s)?; | ||
| if self.eng.input(s).is_ok() { |
Member
There was a problem hiding this comment.
nit: This can be written as self.engine.input(s).map_err(|| fmt::Error)
sanket1729
added a commit
to sanket1729/elements-miniscript
that referenced
this pull request
Oct 21, 2022
…022_10 72dab64 (HEAD -> master, upstream/master, origin/master, origin/HEAD) Merge rust-bitcoin/rust-miniscript#478: allow disabling the checksum with alternate `Display` Also had to fix a bunch of test cases with bare descriptors without el prefix. Add a small API to get the nested segwit descriptors without the el prefix
heap-coder
added a commit
to heap-coder/rust-miniscript
that referenced
this pull request
Sep 27, 2025
…with alternate `Display`
7f5bbdf379db2357dd6449e991805dcceb93106a fixes for 1.41.0 (Andrew Poelstra)
7577e8ceda6d7c83be4f4422ec9be39c11f9050c checksum: use wrapper around fmt::Formatter for all descriptor types (Andrew Poelstra)
84f02921b7b5a617959137c7c9a136e3c1d88f61 checksum: pull computation apart into an engine (Andrew Poelstra)
Pull request description:
Fixes #477
ACKs for top commit:
sanket1729:
ACK 7f5bbdf379db2357dd6449e991805dcceb93106a. The nit is just a stylistic comment.
Tree-SHA512: f4a5bd67bf15d6e59258ec42f0b046b8321103f1baa0e2f893d4e3379623c636f2092596c0c79a0d3b949a436307f052efca72ad2784e42dd23ad861e3036e85
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #477