Skip to content

Commit

Permalink
[gardening] Leverage unsafeMkEntropy in Cardano.Wallet.Gen
Browse files Browse the repository at this point in the history
Unrelated to PR.
  • Loading branch information
Anviking committed Feb 26, 2020
1 parent c7c5644 commit d6f27a7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/core/test/unit/Cardano/Wallet/Gen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ module Cardano.Wallet.Gen
import Prelude

import Cardano.Wallet.Primitive.Mnemonic
( ConsistentEntropy, EntropySize, Mnemonic, entropyToMnemonic, mkEntropy )
( ConsistentEntropy, EntropySize, Mnemonic, entropyToMnemonic )
import Cardano.Wallet.Unsafe
( unsafeMkEntropy )
import Data.Proxy
( Proxy (..) )
import GHC.TypeLits
Expand All @@ -36,5 +38,5 @@ genMnemonic
genMnemonic = do
let n = fromIntegral (natVal $ Proxy @(EntropySize mw)) `div` 8
bytes <- BS.pack <$> vectorOf n arbitrary
let ent = either (error . show) id $ mkEntropy @(EntropySize mw) bytes
let ent = unsafeMkEntropy @(EntropySize mw) bytes
return $ entropyToMnemonic ent

0 comments on commit d6f27a7

Please sign in to comment.