def test_bip39(language: str, test: Sequence[str]) -> None:
    test_entropy = bytes.fromhex(test[0])
    test_mnemonic = test[1]
    test_seed = bytes.fromhex(test[2])

    assert get_mnemonic(language=language,
                        words_path=WORD_LISTS_PATH,
                        entropy=test_entropy) == test_mnemonic
    assert get_seed(mnemonic=test_mnemonic, password='******') == test_seed
Esempio n. 2
0
def test_bip39(language, language_test_vectors):
    for test in language_test_vectors:
        test_entropy = bytes.fromhex(test[0])
        test_mnemonic = test[1]
        test_seed = bytes.fromhex(test[2])

        assert get_mnemonic(language=language,
                            words_path=WORD_LISTS_PATH,
                            entropy=test_entropy) == test_mnemonic
        assert get_seed(mnemonic=test_mnemonic, password='******') == test_seed