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

Haskell support for Bech32m #66

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

roconnor-blockstream
Copy link
Contributor

This also includes a slightly refactored version of PR #41.

Copy link
Contributor

@meshcollider meshcollider left a comment

Choose a reason for hiding this comment

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

Looks good, haven't checked the tests.

ref/haskell/src/Codec/Binary/Bech32.hs Outdated Show resolved Hide resolved
then guard (length witprog == 20 || length witprog == 32) >> return 1
else guard (length witprog >= 2 && length witprog <= 40) >> return bech32mConst
where
bech32mConst = 0x2bc830a3
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be nice to define a global sum type for the two encoding types and have a mapping function from encoding to checksum constant. Then it can be exported to the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@roconnor-blockstream
Copy link
Contributor Author

I've added two commits which I will squash afterwards.

@meshcollider
Copy link
Contributor

utACK 7736efe

@roconnor-blockstream
Copy link
Contributor Author

squashed some commits.

@meshcollider
Copy link
Contributor

meshcollider commented Jan 20, 2022

re-ACK 7d25521, no changes in squash

.gitignore Outdated Show resolved Hide resolved
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.

4 participants