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 24, 2020
1 parent 2ef8c65 commit 6a8a364
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 6a8a364

Please sign in to comment.