commit b6e35cc6e3279317e0187a0713330e8843fe8e96
parent 8e3fa1476f1519afd632bea9c4c2b3b3c58b0bb8
Author: Jared Tobin <jared@jtobin.io>
Date: Thu, 27 Feb 2025 22:37:09 +0400
test: use 'seed' only for english wordlist
Diffstat:
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/test/Main.hs b/test/Main.hs
@@ -76,8 +76,8 @@ execute wlist V.Bip39Test {..} = do
seed = bt_seed
xprv = bt_xprv
out_mnem = BIP39._mnemonic wl entr
- giv_seed = BIP39.seed mnem "TREZOR"
- out_seed = BIP39.seed out_mnem "TREZOR"
+ giv_seed = seed_fn mnem "TREZOR"
+ out_seed = seed_fn out_mnem "TREZOR"
out_xprv = case BIP32.master out_seed of
Just hd -> BIP32.xprv hd
Nothing -> error "bang (bip32)"
@@ -93,6 +93,9 @@ execute wlist V.Bip39Test {..} = do
, testCase "xprv" $ assertEqual mempty xprv out_xprv
]
where
+ seed_fn = case wlist of
+ English -> BIP39.seed
+ _ -> BIP39.seed_unsafe
wl = case wlist of
English -> BIP39.english
ChineseTraditional -> BIP39.chinese_traditional
@@ -113,8 +116,8 @@ execute_jp V.JPBip39Test {..} = do
seed = jp_seed
xprv = jp_xprv
out_mnem = BIP39._mnemonic BIP39.japanese entr
- giv_seed = BIP39.seed mnem pass
- out_seed = BIP39.seed out_mnem pass
+ giv_seed = BIP39.seed_unsafe mnem pass
+ out_seed = BIP39.seed_unsafe out_mnem pass
out_xprv = case BIP32.master out_seed of
Just hd -> BIP32.xprv hd
Nothing -> error "bang (bip32, jp)"