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

Improve error display for invalid witness version #165

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

tcharding
Copy link
Member

We have two errors that cover invalid witness version, for one we print the field element which can be confusing for some values and for the other we omit the invalid version all together - we can do better.

Print the field element as well as the integer value when displaying the two invalid witness version errors.

Fix: #162

@apoelstra
Copy link
Member

LGTM. Arguably fe32 is too jargony. We should maybe say bech32 character instead.

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK d9bb03e

@tcharding
Copy link
Member Author

LGTM. Arguably fe32 is too jargony. We should maybe say bech32 character instead.

yes, good point, will respin.

`Display` imlps often include long lines but the code is simple and
having it split over 4 lines is a waist of vertical space.
We have two errors that cover invalid witness version, for one we print
the field element which can be confusing for some values and for the
other we omit the invalid version all together - we can do better.

Print the field element as well as the integer value when displaying the
two invalid witness version errors.

Fix: rust-bitcoin#162
@tcharding
Copy link
Member Author

Added patch up front to skip rustfmt, then used 'bech32 character' as suggested.

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK e988f34

@apoelstra apoelstra merged commit 84b2c50 into rust-bitcoin:master Jan 9, 2024
12 checks passed
@tcharding tcharding deleted the 01-08-print-witness-as-int branch January 14, 2024 20:41
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 this pull request may close these issues.

InvalidWitnessVersion error display should convert fe to u8
2 participants