Skip to content

Commit

Permalink
Fix a previously undetected bug in the specification.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jonathanknowles committed May 24, 2019
1 parent ec0b86f commit d7e9762
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bech32/test/Codec/Binary/Bech32Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ spec = do

it "hrp lowercased" $ do
let (Right hrp) = humanReadablePartFromText "HRP"
Bech32.encode hrp mempty `shouldBe` Right "hrp1g9xj8m"
Bech32.encode hrp mempty `shouldBe` Right "hrp1vhqs52"

describe "Arbitrary ValidBech32String" $

Expand Down

0 comments on commit d7e9762

Please sign in to comment.