-
Notifications
You must be signed in to change notification settings - Fork 214
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
Fix Bech32 decoder + encoder #312
Commits on May 24, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 8f6e00a - Browse repository at this point
Copy the full SHA 8f6e00aView commit details -
Add functions to convert
DataPart
to and fromText
, using the Bec……h32 alphabet. Also add an accompanying `Read` instance for `DataPart` to accompany the existing `Show` instance. This change also adds a QuickCheck property for the following relationship: >>> read (show (dp :: DataPart)) == dp
Configuration menu - View commit details
-
Copy full SHA for a997218 - Browse repository at this point
Copy the full SHA a997218View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0a6957a - Browse repository at this point
Copy the full SHA 0a6957aView commit details -
Configuration menu - View commit details
-
Copy full SHA for ce734e0 - Browse repository at this point
Copy the full SHA ce734e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5b4d574 - Browse repository at this point
Copy the full SHA 5b4d574View commit details -
Encode to and decode from
Text
instead ofByteString
.Use `Text` as the internal representation for `HumanReadablePart` and `DataPart`. As a side-effect, we can discard the `Read` and `Show` instances for `DataPart`.
Configuration menu - View commit details
-
Copy full SHA for ec0b86f - Browse repository at this point
Copy the full SHA ec0b86fView commit details -
Fix a previously undetected bug in the specification.
The `encode` function was mistakenly expected (by the specification) to produce an invalid Bech32 string, when given an upper-case human readable part. If this invalid string is passed to the `decode` function, it fails (unsurprisingly) to decode. This change updates the specification so that the `encode` function is now expected to produce a valid Bech32 string.
Configuration menu - View commit details
-
Copy full SHA for d7e9762 - Browse repository at this point
Copy the full SHA d7e9762View commit details -
Don't convert to lower-case before calling
humanReadablePartFromText
.In the `Arbitrary` instance for `HumanReadablePart`, we don't need to (and shouldn't) convert the generated string to lower-case before calling `humanReadablePartFromText`. The `humanReadablePartFromText` function itself already converts to lower case.
Configuration menu - View commit details
-
Copy full SHA for 5617740 - Browse repository at this point
Copy the full SHA 5617740View commit details