-
Notifications
You must be signed in to change notification settings - Fork 217
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
Bech32 Library #248
Bech32 Library #248
Conversation
584dbd0
to
dab6d08
Compare
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.
- I've replaced 'tasty' with 'hspec' in the tests for consistency across the project
- I've added some roundtrip fro the encoder and decoder
- I've removed the
segwit
stuff for this is bitcoin-specific. In our case, we'll be looking into https://github.com/input-output-hk/implementation-decisions/blob/master/text/0001-address.md (and the rust implementation as a reference).
This leaves us with a basic encode / decode API for the bech32 format. I've slightly review the high-level module API to be easier to use (using ByteString
as an input type instead of [Word8]
and, removing type alias HRP
in a favor of a newtype HumanReadablePart
with a smart-constructor).
This isn't perfect, but since I know you'll be working on some extra stuff for the error location, I'll leave it to you to iterate on top of this. Please don't spend too much time with this error detection though 🙏
7e66795
to
467c69f
Compare
This makes code more concise, but doesn't affect safety, as this constructor is not exported outside of the `Codec.Binary.Bech32` module.
Use these constants instead of repeating the same hard-coded values in different places.
Use these constants to avoid repeatedly hardcoding the same values within functions.
91d4d12
to
9374258
Compare
@KtorZ I've added more tests, and separated out the modules into public ( I've moved the WIP error location detection code to a separate branch for the moment. ( |
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.
🎉
Issue Number
Issue #238