rust-bitcoin / rust-bech32

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

Fixed error message for too long hrp prefix #179

Closed DariuszDepta closed 6 months ago

DariuszDepta commented 6 months ago

closes #178

apoelstra commented 6 months ago

Hi @DariuszDepta, thanks for the contribution! Can you run cargo fmt on this?

concept ACK this change.

I'm a little unsure if we want unit tests on the Display of our error types. In theory they are part of the public API and they shouldn't change, but on the other hand we may want the flexibility to change them anyway. And if people care about the exact output they should be able to destructure the errors and recreate their own messages.

tcharding commented 6 months ago

I also would prefer to see the error variants tested against instead of the error strings, including the strings is a maintenance burden that adds little value IMO (taking into consideration the bit @apoelstra said about technically beig part of the API).

ACK the non-test bit though, thanks for fixing it!

DariuszDepta commented 6 months ago

I guess it is ready to merge.