Skip to content

Commit

Permalink
Remove WalletKey from DerivationSpec.
Browse files Browse the repository at this point in the history
  • Loading branch information
paolino committed May 25, 2023
1 parent bd4dbd1 commit 374df12
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions lib/wallet/test/unit/Cardano/Wallet/Address/DerivationSpec.hs
Expand Up @@ -25,7 +25,6 @@ import Cardano.Wallet.Address.Derivation
, DerivationType (..)
, Index
, PersistPublicKey (..)
, WalletKey (..)
, getIndex
)
import Cardano.Wallet.Address.Derivation.Byron
Expand All @@ -36,6 +35,8 @@ import Cardano.Wallet.Address.Derivation.Shelley
( ShelleyKey (..) )
import Cardano.Wallet.Address.Keys.PersistPrivateKey
( serializeXPrv, unsafeDeserializeXPrv )
import Cardano.Wallet.Address.Keys.WalletKey
( getRawKeyNew, publicKeyNew )
import Cardano.Wallet.Flavor
( KeyFlavorS (..) )
import Cardano.Wallet.Gen
Expand Down Expand Up @@ -324,11 +325,13 @@ instance Arbitrary (ShelleyKey 'RootK XPrv) where

instance Arbitrary (ShelleyKey 'AccountK XPub) where
shrink _ = []
arbitrary = publicKey <$> (genRootKeysSeqWithPass =<< genPassphrase (0, 16))
arbitrary =
publicKeyNew ShelleyKeyS
<$> (genRootKeysSeqWithPass =<< genPassphrase (0, 16))

instance Arbitrary (ShelleyKey 'RootK XPub) where
shrink _ = []
arbitrary = publicKey <$> arbitrary
arbitrary = publicKeyNew ShelleyKeyS <$> arbitrary

instance Arbitrary (ByronKey 'RootK XPrv) where
shrink _ = []
Expand All @@ -340,7 +343,9 @@ instance Arbitrary (IcarusKey 'RootK XPrv) where

instance Arbitrary (IcarusKey 'AccountK XPub) where
shrink _ = []
arbitrary = publicKey <$> (genRootKeysIcaWithPass =<< genPassphrase (0, 16))
arbitrary =
publicKeyNew IcarusKeyS
<$> (genRootKeysIcaWithPass =<< genPassphrase (0, 16))

newtype Unencrypted a = Unencrypted { getUnencrypted :: a }
deriving (Eq, Show)
Expand Down Expand Up @@ -369,11 +374,11 @@ genAnyKeyWithPass
:: Passphrase "encryption"
-> Gen XPrv
genAnyKeyWithPass pwd = oneof
[ getRawKey
[ getRawKeyNew ShelleyKeyS
<$> genRootKeysSeqWithPass pwd
, getRawKey
, getRawKeyNew ByronKeyS
<$> genRootKeysRndWithPass pwd
, getRawKey
, getRawKeyNew IcarusKeyS
<$> genRootKeysIcaWithPass pwd
]

Expand Down

0 comments on commit 374df12

Please sign in to comment.