View on GitHub
File Changes
m
+0/-1
    shell = haskellPackages.shellFor {
      name = "cardano-wallet-shell";
      packages = ps: with ps; [
-
        bech32
        cardano-wallet-cli
        cardano-wallet-core
        cardano-wallet-core-integration
-
# Bech32 library
-

                      
-
The library implements Bech32 which is a segwit address format specified by [BIP-0173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki).
-
It is a checksummed base32 format and a standard for native segregated witness output addresses using it.
-

                      
-
# How to use it
-

                      
-
See the hello world example below:
-

                      
-
``` haskell
-
λ import Codec.Binary.Bech32
-
λ import Prelude
-
λ let (Right hrp) = humanReadablePartFromText "ca"
-
λ hrp
-
HumanReadablePart "ca"
-
λ import Data.Text
-
λ let addr = "835823f15b7085fe1efb6af305e65da62bcf5226779a91dd3130b155cb697782b1" :: Text
-
λ import Data.Text.Encoding
-
λ let dataPart = dataPartFromBytes (encodeUtf8 addr)
-
λ dataPart
-
DataPart "8qen2wpjxdnrzdtzxucrsdtxv5ck2enzxeskvvesx4jnvdtyvymrycnrvc6nyv3kxumnjcfex9jxgve3xvcxyvf4x43kyd3exumnsvnzxy"
-
λ let bech32encoded = encodeLenient hrp dataPart
-
"ca18qen2wpjxdnrzdtzxucrsdtxv5ck2enzxeskvvesx4jnvdtyvymrycnrvc6nyv3kxumnjcfex9jxgve3xvcxyvf4x43kyd3exumnsvnzxys57suf"
-
λ decodeLenient bech32encoded
-
Right (HumanReadablePart "ca",DataPart "8qen2wpjxdnrzdtzxucrsdtxv5ck2enzxeskvvesx4jnvdtyvymrycnrvc6nyv3kxumnjcfex9jxgve3xvcxyvf4x43kyd3exumnsvnzxy")
-
```
-

                      
-
For more inspiration, have a look at the property tests within the `test` directory.
-
name:          bech32
-
version:       2020.1.27
-
synopsis:      Implementation of the Bech32 segwit address format (BIP 0173).
-
homepage:      https://github.com/input-output-hk/cardano-wallet
-
author:        IOHK Engineering Team
-
maintainer:    [email protected]
-
copyright:     2017 Marko Bencun, 2019-2020 IOHK
-
license:       Apache-2.0
-
category:      Web
-
build-type:    Simple
-
cabal-version: >=1.10
-

                      
-
flag development
-
    description: Disable `-Werror`
-
    default: False
-
    manual: True
-

                      
-
library
-
  default-language:
-
      Haskell2010
-
  default-extensions:
-
      NoImplicitPrelude
-
      OverloadedStrings
-
  ghc-options:
-
      -Wall
-
      -Wcompat
-
      -fwarn-redundant-constraints
-
  if (!flag(development))
-
    ghc-options:
-
      -Werror
-
  build-depends:
-
      array
-
    , base
-
    , bytestring
-
    , containers
-
    , extra
-
    , text
-
    , text-class
-
  hs-source-dirs:
-
      src
-
  exposed-modules:
-
      Codec.Binary.Bech32
-
      Codec.Binary.Bech32.Internal
-

                      
-
test-suite bech32-test
-
  default-language:
-
      Haskell2010
-
  type:
-
      exitcode-stdio-1.0
-
  hs-source-dirs:
-
      test
-
  ghc-options:
-
      -threaded -rtsopts -with-rtsopts=-N
-
      -O2
-
      -Wall
-
  if (!flag(development))
-
    ghc-options:
-
      -Werror
-
  build-depends:
-
      base
-
    , bech32
-
    , bytestring
-
    , containers
-
    , deepseq
-
    , extra
-
    , hspec
-
    , QuickCheck
-
    , text
-
    , vector
-
  build-tools:
-
      hspec-discover
-
  main-is:
-
      Main.hs
-
  other-modules:
-
      Codec.Binary.Bech32Spec
-
-- |
-
-- Copyright: © 2017 Marko Bencun, 2018-2020 IOHK
-
-- License: Apache-2.0
-
--
-
-- Implementation of the [Bech32]
-
-- (https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki)
-
-- address format.
-
--
-
-- From an original implementation by Marko Bencun:
-
--
-
-- [sipa/bech32](https://github.com/sipa/bech32/tree/bdc264f84014c234e908d72026b7b780122be11f/ref/haskell)
-

                      
-
module Codec.Binary.Bech32
-
    (
-
      -- * Encoding & Decoding
-
      encode
-
    , encodeLenient
-
    , EncodingError (..)
-
    , decode
-
    , decodeLenient
-
    , DecodingError (..)
-

                      
-
      -- * Data Part
-
    , DataPart
-
    , dataPartFromBytes
-
    , dataPartFromText
-
    , dataPartToBytes
-
    , dataPartToText
-

                      
-
      -- * Human-Readable Part
-
    , HumanReadablePart
-
    , HumanReadablePartError (..)
-
    , humanReadablePartFromText
-
    , humanReadablePartToText
-
    ) where
-

                      
-
import Codec.Binary.Bech32.Internal
-
{-# LANGUAGE DataKinds #-}
-
{-# LANGUAGE DerivingStrategies #-}
-
{-# LANGUAGE FlexibleContexts #-}
-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-
{-# LANGUAGE LambdaCase #-}
-
{-# LANGUAGE TypeFamilies #-}
-
{-# LANGUAGE TypeOperators #-}
-
{-# LANGUAGE UndecidableInstances #-}
-

                      
-
-- |
-
-- Copyright: © 2017 Marko Bencun, 2018-2020 IOHK
-
-- License: Apache-2.0
-
--
-
-- Implementation of the [Bech32]
-
-- (https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki)
-
-- address format.
-
--
-
-- From an original implementation by Marko Bencun:
-
--
-
-- [sipa/bech32](https://git.io/fj8FV)
-
--
-
module Codec.Binary.Bech32.Internal
-
    (
-
      -- * Encoding & Decoding
-
      encode
-
    , encodeLenient
-
    , EncodingError (..)
-
    , decode
-
    , decodeLenient
-
    , DecodingError (..)
-
    , checksumLength
-
    , encodedStringMaxLength
-
    , encodedStringMinLength
-
    , separatorChar
-
    , separatorLength
-

                      
-
      -- * Data Part
-
    , DataPart
-
    , dataPartIsValid
-
    , dataPartFromBytes
-
    , dataPartFromText
-
    , dataPartFromWords
-
    , dataPartToBytes
-
    , dataPartToText
-
    , dataPartToWords
-
    , dataCharToWord
-
    , dataCharFromWord
-
    , dataCharList
-

                      
-
      -- * Human-Readable Part
-
    , HumanReadablePart
-
    , HumanReadablePartError (..)
-
    , humanReadablePartFromText
-
    , humanReadablePartToText
-
    , humanReadablePartToWords
-
    , humanReadablePartMinLength
-
    , humanReadablePartMaxLength
-
    , humanReadableCharMinBound
-
    , humanReadableCharMaxBound
-

                      
-
      -- * Bit Manipulation
-
    , convertBits
-
    , Word5
-
    , word5
-
    , getWord5
-
    , toBase256
-
    , toBase32
-
    , noPadding
-
    , yesPadding
-

                      
-
      -- * Character Manipulation
-
    , CharPosition (..)
-

                      
-
    ) where
-

                      
-
import Prelude
-

                      
-
import Control.Monad
-
    ( guard, join )
-
import Data.Array
-
    ( Array )
-
import Data.Bifunctor
-
    ( first )
-
import Data.Bits
-
    ( Bits, testBit, unsafeShiftL, unsafeShiftR, xor, (.&.), (.|.) )
-
import Data.ByteString
-
    ( ByteString )
-
import Data.Char
-
    ( chr, ord, toLower, toUpper )
-
import Data.Either.Extra
-
    ( maybeToEither )
-
import Data.Foldable
-
    ( foldl' )
-
import Data.Functor.Identity
-
    ( Identity, runIdentity )
-
import Data.Ix
-
    ( Ix (..) )
-
import Data.List
-
    ( sort )
-
import Data.Map.Strict
-
    ( Map )
-
import Data.Maybe
-
    ( isNothing, mapMaybe )
-
import Data.Text
-
    ( Text )
-
import Data.Text.Class
-
    ( splitAtLastOccurrence )
-
import Data.Word
-
    ( Word8 )
-

                      
-
import qualified Data.Array as Arr
-
import qualified Data.ByteString as BS
-
import qualified Data.Map.Strict as Map
-
import qualified Data.Text as T
-

                      
-
{-------------------------------------------------------------------------------
-
                                 Data Part
-
-------------------------------------------------------------------------------}
-

                      
-
-- | Represents the data part of a Bech32 string, as defined here:
-
--   https://git.io/fj8FS
-
newtype DataPart = DataPart Text
-
    deriving newtype (Eq, Monoid, Semigroup)
-
    deriving stock Show
-

                      
-
-- | Returns true iff. the specified 'DataPart' is valid.
-
--
-
dataPartIsValid :: DataPart -> Bool
-
dataPartIsValid (DataPart dp) = T.all dataCharIsValid dp
-

                      
-
-- | Constructs a 'DataPart' from a 'ByteString'.
-
--
-
-- This function encodes a 'ByteString' in such a way that guarantees it can be
-
-- successfully decoded with the 'dataPartToBytes' function:
-
--
-
-- > dataPartToBytes (dataPartFromBytes b) == Just b
-
--
-
dataPartFromBytes :: ByteString -> DataPart
-
dataPartFromBytes =
-
    DataPart . T.pack . fmap dataCharFromWord . toBase32 . BS.unpack
-

                      
-
-- | Attempts to extract a 'ByteString' from a 'DataPart'.
-
--
-
-- This function guarantees to satisfy the following property:
-
--
-
-- > dataPartToBytes (dataPartFromBytes b) == Just b
-
--
-
dataPartToBytes :: DataPart -> Maybe ByteString
-
dataPartToBytes dp = BS.pack <$>
-
    (toBase256 =<< traverse dataCharToWord (T.unpack $ dataPartToText dp))
-

                      
-
-- | Constructs a 'DataPart' from textual input. All characters in the input
-
--   must be a member of 'dataCharList', the set of characters permitted to
-
--   appear within the data part of a Bech32 string.
-
--
-
-- Returns 'Nothing' if any character in the input is not a member of
-
-- 'dataCharList'.
-
--
-
-- This function guarantees to satisfy the following property:
-
--
-
-- > dataPartFromText (dataPartToText d) == Just d
-
--
-
dataPartFromText :: Text -> Maybe DataPart
-
dataPartFromText text
-
    | T.any (not . dataCharIsValid) textLower = Nothing
-
    | otherwise = pure $ DataPart textLower
-
  where
-
    textLower = T.toLower text
-

                      
-
-- | Converts a 'DataPart' to 'Text', using the Bech32 character set to render
-
--   the data.
-
--
-
-- This function guarantees to satisfy the following property:
-
--
-
-- > dataPartFromText (dataPartToText d) == Just d
-
--
-
dataPartToText :: DataPart -> Text
-
dataPartToText (DataPart t) = t
-

                      
-
-- | Construct a 'DataPart' directly from words.
-
--
-
-- This function guarantees to satisfy the following properties:
-
--
-
-- > dataPartFromWords (dataPartToWords d) == d
-
-- > dataPartToWords (dataPartFromWords w) == w
-
--
-
dataPartFromWords :: [Word5] -> DataPart
-
dataPartFromWords = DataPart . T.pack . fmap dataCharFromWord
-

                      
-
-- | Convert a 'DataPart' into words.
-
--
-
dataPartToWords :: DataPart -> [Word5]
-
dataPartToWords = mapMaybe dataCharToWord . T.unpack . dataPartToText
-

                      
-
-- | Returns true iff. the specified character is permitted to appear within
-
--   the data part of a Bech32 string.
-
--   See here for more details: https://git.io/fj8FS
-
dataCharIsValid :: Char -> Bool
-
dataCharIsValid = (`Map.member` dataCharToWordMap)
-
{-# LANGUAGE DerivingStrategies #-}
-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-
{-# LANGUAGE LambdaCase #-}
-
{-# LANGUAGE OverloadedStrings #-}
-
{-# LANGUAGE ScopedTypeVariables #-}
-
{-# LANGUAGE TypeApplications #-}
-
{-# OPTIONS_GHC -fno-warn-orphans #-}
-

                      
-
module Codec.Binary.Bech32Spec
-
    ( spec
-
    ) where
-

                      
-
import Prelude
-

                      
-
import Codec.Binary.Bech32.Internal
-
    ( CharPosition (..)
-
    , DataPart
-
    , DecodingError (..)
-
    , HumanReadablePart
-
    , dataPartFromBytes
-
    , dataPartFromText
-
    , dataPartFromWords
-
    , dataPartIsValid
-
    , dataPartToWords
-
    , humanReadableCharMaxBound
-
    , humanReadableCharMinBound
-
    , humanReadablePartFromText
-
    , humanReadablePartToText
-
    , separatorChar
-
    )
-
import Control.DeepSeq
-
    ( deepseq )
-
import Control.Monad
-
    ( forM_, replicateM )
-
import Data.Bits
-
    ( xor, (.&.) )
-
import Data.ByteString
-
    ( ByteString )
-
import Data.Char
-
    ( chr, isUpper, ord, toLower, toUpper )
-
import Data.Either
-
    ( fromRight, isRight )
-
import Data.Either.Extra
-
    ( eitherToMaybe )
-
import Data.Functor.Identity
-
    ( runIdentity )
-
import Data.List
-
    ( intercalate )
-
import Data.Maybe
-
    ( catMaybes, fromMaybe, isJust )
-
import Data.Set
-
    ( Set )
-
import Data.Text
-
    ( Text )
-
import Data.Vector
-
    ( Vector )
-
import Data.Word
-
    ( Word8 )
-
import Test.Hspec
-
    ( Spec, describe, expectationFailure, it, shouldBe, shouldSatisfy )
-
import Test.QuickCheck
-
    ( Arbitrary (..)
-
    , Positive (..)
-
    , arbitraryBoundedEnum
-
    , choose
-
    , counterexample
-
    , cover
-
    , elements
-
    , property
-
    , withMaxSuccess
-
    , (.&&.)
-
    , (.||.)
-
    , (===)
-
    , (==>)
-
    )
-

                      
-
import qualified Codec.Binary.Bech32.Internal as Bech32
-
import qualified Data.ByteString as BS
-
import qualified Data.Set as Set
-
import qualified Data.Text as T
-
import qualified Data.Vector as V
-

                      
-
spec :: Spec
-
spec = do
-
    describe "Valid Reference Strings" $
-
        it "should always decode successfully" $
-
            forM_ validBech32Strings $ \s ->
-
                Bech32.decode s `shouldSatisfy` isRight
-

                      
-
    describe "Valid Checksums" $ forM_ validChecksums $ \checksum ->
-
        it (T.unpack checksum) $ case Bech32.decode checksum of
-
            Left _ ->
-
                expectationFailure (show checksum)
-
            Right (resultHRP, resultData) -> do
-
                -- test that a corrupted checksum fails decoding.
-
                let (hrp, rest) =
-
                        T.breakOnEnd (T.singleton separatorChar) checksum
-
                let Just (first, rest') = T.uncons rest
-
                let checksumCorrupted =
-
                        (hrp `T.snoc` (chr (ord first `xor` 1)))
-
                        `T.append` rest'
-
                (Bech32.decode checksumCorrupted) `shouldSatisfy` isLeft'
-
                -- test that re-encoding the decoded checksum results in
-
                -- the same checksum.
-
                let checksumEncoded = Bech32.encode resultHRP resultData
-
                let expectedChecksum = Right $ T.map toLower checksum
-
                checksumEncoded `shouldBe` expectedChecksum
-

                      
-
    describe "Invalid Checksums" $ forM_ invalidChecksums $
-
        \(checksum, expect) ->
-
            it (T.unpack checksum) $
-
                Bech32.decode checksum `shouldBe` (Left expect)
-

                      
-
    describe "More Encoding/Decoding Cases" $ do
-
        it "length > maximum" $ do
-
            let hrpUnpacked = "ca"
-
            let hrpLength = length hrpUnpacked
-
            let (Right hrp) = humanReadablePartFromText (T.pack hrpUnpacked)
-
            let maxDataLength =
-
                    Bech32.encodedStringMaxLength
-
                    - Bech32.checksumLength - Bech32.separatorLength - hrpLength
-
            Bech32.encode hrp
-
                (dataPartFromWords (replicate (maxDataLength + 1)
-
                    $ Bech32.word5 @Word8 1))
-
                `shouldBe` Left Bech32.EncodedStringTooLong
-

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

                      
-
    describe "Arbitrary Bech32String" $
-

                      
-
        it "Generation always produces a valid string that can be decoded." $
-
            property $ \v ->
-
                Bech32.decode (getBech32String v) `shouldBe`
-
                    Right (humanReadablePart v, unencodedDataPart v)
-

                      
-
    describe "Arbitrary Bech32Char" $ do
-

                      
-
        it "Generation always produces a valid character." $
-
            property $ withMaxSuccess 10000 $ \c ->
-
                let char = getBech32Char c in
-
                cover 30 (      isDataChar char) "is a data character: TRUE"  $
-
                cover 30 (not $ isDataChar char) "is a data character: FALSE" $
-
                isBech32Char char
-

                      
-
        it "Shrinking always produces valid characters." $
-
            property $ withMaxSuccess 10000 $ \c ->
-
                all (isBech32Char . getBech32Char) $ shrink c
-

                      
-
        it "Shrinking always produces characters with codes that are smaller." $
-
            property $ withMaxSuccess 10000 $ \c ->
-
                all (< c) $ shrink (c :: Bech32Char)
-

                      
-
    describe "Decoding a corrupted string should fail" $ do
-

                      
-
        it "Decoding fails when an adjacent pair of characters is swapped." $
-
            property $ withMaxSuccess 10000 $ \s -> do
-
                let originalString = getBech32String s
-
                index <- choose (0, T.length originalString - 2)
-
                let prefix = T.take index originalString
-
                let suffix = T.drop (index + 2) originalString
-
                let char1 = T.singleton (T.index originalString index)
-
                let char2 = T.singleton (T.index originalString $ index + 1)
-
                let corruptedString = prefix <> char2 <> char1 <> suffix
-
                let description = intercalate "\n"
-
                        [ "index of char #1: " <> show index
-
                        , "index of char #2: " <> show (index + 1)
-
                        , "         char #1: " <> show char1
-
                        , "         char #2: " <> show char2
-
                        , " original string: " <> show originalString
-
                        , "corrupted string: " <> show corruptedString ]
-
                return $ counterexample description $
-
                    char1 /= char2 ==>
-
                        (T.length corruptedString === T.length originalString)
-
                        .&&.
-
                        (Bech32.decode corruptedString `shouldSatisfy` isLeft')
-

                      
-
        it "Decoding fails when a character is omitted." $
-
            property $ withMaxSuccess 10000 $ \s -> do
-
                let originalString = getBech32String s
-
                index <- choose (0, T.length originalString - 1)
-
                let char = T.index originalString index
-
                let prefix = T.take index originalString
-
                let suffix = T.drop (index + 1) originalString
-
                let corruptedString = prefix <> suffix
-
                let description = intercalate "\n"
-
                        [ "index of omitted char: " <> show index
-
                        , "         omitted char: " <> show char
-
                        , "      original string: " <> show originalString
-
                        , "     corrupted string: " <> show corruptedString ]
-
                return $ counterexample description $
-
                    (T.length corruptedString === T.length originalString - 1)
-
                    .&&.
-
                    (Bech32.decode corruptedString `shouldSatisfy` isLeft')
-
                    .||.
-
                    -- In the case where the tail of a valid Bech32 string is
-
                    -- composed of one or more consecutive 'q' characters
-
                    -- followed by a single 'p' character, omitting any or all
-
{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
-
let
-
  buildDepError = pkg:
-
    builtins.throw ''
-
      The Haskell package set does not contain the package: ${pkg} (build dependency).
-
      
-
      If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
-
      '';
-
  sysDepError = pkg:
-
    builtins.throw ''
-
      The Nixpkgs package set does not contain the package: ${pkg} (system dependency).
-
      
-
      You may need to augment the system package mapping in haskell.nix so that it can be found.
-
      '';
-
  pkgConfDepError = pkg:
-
    builtins.throw ''
-
      The pkg-conf packages does not contain the package: ${pkg} (pkg-conf dependency).
-
      
-
      You may need to augment the pkg-conf package mapping in haskell.nix so that it can be found.
-
      '';
-
  exeDepError = pkg:
-
    builtins.throw ''
-
      The local executable components do not include the component: ${pkg} (executable dependency).
-
      '';
-
  legacyExeDepError = pkg:
-
    builtins.throw ''
-
      The Haskell package set does not contain the package: ${pkg} (executable dependency).
-
      
-
      If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
-
      '';
-
  buildToolDepError = pkg:
-
    builtins.throw ''
-
      Neither the Haskell package set or the Nixpkgs package set contain the package: ${pkg} (build tool dependency).
-
      
-
      If this is a system dependency:
-
      You may need to augment the system package mapping in haskell.nix so that it can be found.
-
      
-
      If this is a Haskell dependency:
-
      If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
-
      '';
-
in { system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }:
-
  {
-
    flags = { development = false; };
-
    package = {
-
      specVersion = "1.10";
-
      identifier = { name = "bech32"; version = "2020.1.27"; };
-
      license = "Apache-2.0";
-
      copyright = "2017 Marko Bencun, 2019-2020 IOHK";
-
      maintainer = "[email protected]";
-
      author = "IOHK Engineering Team";
-
      homepage = "https://github.com/input-output-hk/cardano-wallet";
-
      url = "";
-
      synopsis = "Implementation of the Bech32 segwit address format (BIP 0173).";
-
      description = "";
-
      buildType = "Simple";
-
      isLocal = true;
-
      };
-
    components = {
-
      "library" = {
-
        depends = [
-
          (hsPkgs."array" or (buildDepError "array"))
-
          (hsPkgs."base" or (buildDepError "base"))
-
          (hsPkgs."bytestring" or (buildDepError "bytestring"))
-
          (hsPkgs."containers" or (buildDepError "containers"))
-
          (hsPkgs."extra" or (buildDepError "extra"))
-
          (hsPkgs."text" or (buildDepError "text"))
-
          (hsPkgs."text-class" or (buildDepError "text-class"))
-
          ];
-
        buildable = true;
-
        };
-
      tests = {
-
        "bech32-test" = {
-
          depends = [
-
            (hsPkgs."base" or (buildDepError "base"))
-
            (hsPkgs."bech32" or (buildDepError "bech32"))
-
            (hsPkgs."bytestring" or (buildDepError "bytestring"))
-
            (hsPkgs."containers" or (buildDepError "containers"))
-
            (hsPkgs."deepseq" or (buildDepError "deepseq"))
-
            (hsPkgs."extra" or (buildDepError "extra"))
-
            (hsPkgs."hspec" or (buildDepError "hspec"))
-
            (hsPkgs."QuickCheck" or (buildDepError "QuickCheck"))
-
            (hsPkgs."text" or (buildDepError "text"))
-
            (hsPkgs."vector" or (buildDepError "vector"))
-
            ];
-
          build-tools = [
-
            (hsPkgs.buildPackages.hspec-discover or (pkgs.buildPackages.hspec-discover or (buildToolDepError "hspec-discover")))
-
            ];
-
          buildable = true;
-
          };
-
        };
-
      };
-
    } // rec { src = (pkgs.lib).mkDefault ../.././lib/bech32; }
\ No newline at end of file
    {
      packages = {
        "base58-bytestring" = (((hackage.base58-bytestring)."0.1.0").revisions).default;
+
        "bech32" = (((hackage.bech32)."1.0.1").revisions).default;
        "OddWord" = (((hackage.OddWord)."1.0.2.0").revisions).default;
        "quickcheck-state-machine" = (((hackage.quickcheck-state-machine)."0.6.0").revisions).default;
        "command" = (((hackage.command)."0.1.1").revisions).default;
        "canonical-json" = (((hackage.canonical-json)."0.6.0.0").revisions)."9021f435ccb884a3b4c55bcc6b50eb19d5fc3cc3f29d5fcbdef016f5bbae23a2";
        "cborg" = (((hackage.cborg)."0.2.2.0").revisions)."eaee50d09d766af95ba18348e4fc230243033b98633ed46ccb5ae85efef7dc6c";
        "statistics-linreg" = (((hackage.statistics-linreg)."0.3").revisions)."95c6efe6c7f6b26bc6e9ada90ab2d18216371cf59a6ef2b517b4a6fd35d9a76f";
-
        bech32 = ./bech32.nix;
        cardano-wallet-core = ./cardano-wallet-core.nix;
        cardano-wallet-core-integration = ./cardano-wallet-core-integration.nix;
        cardano-wallet-cli = ./cardano-wallet-cli.nix;
{
  "url": "https://github.com/input-output-hk/haskell.nix",
-
  "rev": "d7d24fde4b5c0ebcd704e96aba79e2a148583af7",
-
  "date": "2020-01-09T16:07:34+10:00",
-
  "sha256": "1p3frk62gb85jb0cdw2rkrsyxaafij98ir45icil30bcwhp4j4q3",
+
  "rev": "e1b57495cf3c4bb2a51d3aeb1d5d88c68740e209",
+
  "date": "2020-02-14T11:21:04+08:00",
+
  "sha256": "1axy7r5hhj0m776w58xh3xfyjmvss50hir86w31xc0zv820hf1hr",
  "fetchSubmodules": false
}
m
+0/-1
        packages.cardano-wallet-test-utils.src = filterSubDir /lib/test-utils;
        packages.text-class.src = filterSubDir /lib/text-class;
        packages.text-class.components.tests.unit.keepSource = true;
-
        packages.bech32.src = filterSubDir /lib/bech32;
      }

                      
      # Add dependencies
m
+1/-1
  isCardanoWallet = package:
    (package.isHaskell or false) &&
      ((hasPrefix "cardano-wallet" package.identifier.name) ||
-
       (elem package.identifier.name [ "text-class" "bech32" ]));
+
       (elem package.identifier.name [ "text-class" ]));

                      
  inherit (pkgs.haskell-nix.haskellLib) collectComponents;
}
m
+1/-1
resolver: lts-13.24

                      
packages:
-
- lib/bech32
- lib/core
- lib/core-integration
- lib/cli
extra-deps:
# Miscellaneous
- base58-bytestring-0.1.0
+
- bech32-1.0.1
- OddWord-1.0.2.0
- quickcheck-state-machine-0.6.0
- command-0.1.1