Skip to content

Haskell support for Bech32m#66

Open
roconnor-blockstream wants to merge 3 commits into
sipa:masterfrom
roconnor-blockstream:2021110_haskell_bech32m
Open

Haskell support for Bech32m#66
roconnor-blockstream wants to merge 3 commits into
sipa:masterfrom
roconnor-blockstream:2021110_haskell_bech32m

Conversation

@roconnor-blockstream

Copy link
Copy Markdown
Contributor

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

@meshcollider meshcollider left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread ref/haskell/src/Codec/Binary/Bech32.hs Outdated
Comment thread ref/haskell/src/Codec/Binary/Bech32.hs Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@meshcollider

Copy link
Copy Markdown
Contributor

utACK 7736efe

@roconnor-blockstream

Copy link
Copy Markdown
Contributor Author

squashed some commits.

@meshcollider

meshcollider commented Jan 20, 2022

Copy link
Copy Markdown
Contributor

re-ACK 7d25521, no changes in squash

Comment thread .gitignore Outdated
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