-
Notifications
You must be signed in to change notification settings - Fork 427
fix: no Debug on Display implementations
#2083
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
fix: no Debug on Display implementations
#2083
Conversation
492114b to
b73016e
Compare
|
Concept ACK — this approach looks good, thanks for the changes. I ran the tests locally and they all passed. While trying to recreate the initial issue’s scenario (#1933), I found that I have a few small suggestions below. Most of these are nits, but since this PR is already addressing the area, I thought it’d be reasonable to mention them here:
|
evanlinjin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quality work.
Just a couple requested changes:
- Commit messages should contain a scope (as mentioned in the conventional commits spec). The scope should be the name of the package affected:
core,chain,example, etc. - Commits that break the API should be marked with
!.
And a nit:
- Error messages should be somewhat consistent. I personally don't think we should suggest actions in the message, just state what the error is.
|
@Dmenec are you able to make progress on this? |
b73016e to
532e2ec
Compare
|
@evanlinjin Pushed the updates. Let me know if everything checks out :) |
evanlinjin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 532e2ec
I'm happy with how this is looking. Unable to test until I have access to a computer again.
789d8a3 to
d65eed0
Compare
|
Having some trouble with the no_std CI check for the esplora crate... Does it actually support no_std, or should be treated as std‑only? |
@Dmenec It's now fixed on master, a rebase should fix it. |
f0698e1 to
d65eed0
Compare
d65eed0 to
ae17df2
Compare
91abd25 to
75d1bd0
Compare
evanlinjin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the bike-shedding. We're very close.
oleonardolima
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks good, it just need to address Evan's comments.
…iptorError Replace Debug-based formatting with user-friendly Display messages.
2763989 to
744a3de
Compare
…eError Limited to 3 max shown items and added a suffix when there are additional entries.
…rror. Format magic bytes as 0x-prefixed hex.
744a3de to
823e4e9
Compare
evanlinjin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 823e4e9
I'm going to merge this as is. My nit-pick can be addressed in follow ups.
| fee.display_dynamic() | ||
| ), | ||
| CalculateFeeError::MissingTxOut(outpoints) => { | ||
| let max_show = 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I were to nit-pick, I would say get rid of this and just show all prev outputs.
|
|
||
| write!(f, "cannot calculate fee, missing previous output(s): ")?; | ||
| if outpoints.is_empty() { | ||
| write!(f, "<none>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this ever happens, it's a bug in the library - let's debug_assert! it?
Description
Fixes #1933, remove the usage of
DebugonDisplayimplemetations mentioned in #1881 (comment)Changelog notice
Debugusage withDisplaymessages forInsertDescriptorError,CalculateFeeErrorandStoreError.InvalidMagicBytesnow displays expected and actual bytes in hexadecimal instead of usingDebug.short_descriptorfunction to shorten descriptors for concise error output.SyncRequestDisplayfor Esplora and Electrum examples.Checklists
All Submissions:
just check,just fmtandjust testbefore committing