From 6a8a364de4ee7bf8521f6120dc1d1ce95aa025f3 Mon Sep 17 00:00:00 2001 From: Johannes Lund Date: Thu, 20 Feb 2020 20:20:29 +0100 Subject: [PATCH] [gardening] Leverage unsafeMkEntropy in Cardano.Wallet.Gen Unrelated to PR. --- lib/core/test/unit/Cardano/Wallet/Gen.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/core/test/unit/Cardano/Wallet/Gen.hs b/lib/core/test/unit/Cardano/Wallet/Gen.hs index 59357f9eb38..2ffbeda3d88 100644 --- a/lib/core/test/unit/Cardano/Wallet/Gen.hs +++ b/lib/core/test/unit/Cardano/Wallet/Gen.hs @@ -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 @@ -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