View on GitHub
File Changes
    ( DelegationAddress (..)
    , Depth (..)
    , NetworkDiscriminant (..)
-
    , Passphrase (..)
+
    , SomeMnemonic (..)
    , WalletKey (..)
    , XPub
    , xpub
    , mkSeqState
    )
import Cardano.Wallet.Primitive.Mnemonic
-
    ( EntropySize, entropyToBytes, genEntropy )
+
    ( EntropySize, entropyToMnemonic, genEntropy, mkEntropy )
import Cardano.Wallet.Primitive.Model
    ( Wallet, initWallet, unsafeInitWallet )
import Cardano.Wallet.Primitive.Types
import System.Random
    ( mkStdGen, randoms )

                      
-
import qualified Data.ByteArray as BA
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as B8
import qualified Data.Map.Strict as Map
initDummyState =
    mkSeqState (xprv, mempty) defaultAddressPoolGap
  where
-
    bytes = entropyToBytes <$> unsafePerformIO $ genEntropy @(EntropySize 15)
-
    xprv = generateKeyFromSeed (Passphrase bytes, mempty) mempty
+
    mnemonic = unsafePerformIO $
+
        SomeMnemonic
+
        . entropyToMnemonic @15
+
        <$> genEntropy @(EntropySize 15)
+
    xprv = generateKeyFromSeed (mnemonic, Nothing) mempty

                      
testMetadata :: WalletMetadata
testMetadata = WalletMetadata
testPk = PrimaryKey testWid

                      
ourAccount :: ShelleyKey 'AccountK XPub
-
ourAccount = publicKey $ unsafeGenerateKeyFromSeed (seed, mempty) mempty
-
  where seed = Passphrase $ BA.convert $ BS.replicate 32 0
+
ourAccount = publicKey $ unsafeGenerateKeyFromSeed (seed, Nothing) mempty
+
  where
+
    seed = SomeMnemonic $ entropyToMnemonic @15 ent
+
    ent = either (error . show) id $ mkEntropy $ BS.replicate 32 0

                      
rewardAccount :: ShelleyKey 'AddressK XPub
-
rewardAccount = publicKey $ unsafeGenerateKeyFromSeed (seed, mempty) mempty
-
  where seed = Passphrase $ BA.convert $ BS.replicate 32 0
+
rewardAccount = publicKey $ unsafeGenerateKeyFromSeed (seed, Nothing) mempty
+
  where
+
    seed = SomeMnemonic $ entropyToMnemonic @15 ent
+
    ent = either (error . show) id $ mkEntropy $ BS.replicate 32 0

                      
-- | Make a prefixed bytestring for use as a Hash or Address.
label :: Show n => String -> n -> B8.ByteString