rust-bitcoin / rust-bech32

Bech32 format encoding and decoding
MIT License
93 stars 49 forks source link

Improve error display for invalid witness version #165

Closed tcharding closed 8 months ago

tcharding commented 8 months ago

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 commented 8 months ago

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

tcharding commented 8 months ago

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

yes, good point, will respin.

tcharding commented 8 months ago

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